User tests: Successful: Unsuccessful:
Pull Request for Issue #24535 (part).
This PR fixes all datetime columns of com_finder (Smart Search) tables so there will not be any Invalid value '0000-00-00 00:00:00' for datetime
error anymore on MySQL 5.7 or later when strict mode is enabled, and the datetime
(MySQL) or timestamp without time zone
(PostgreSQL) columns will allow NULL
values wherever useful/possible.
Because Smart Search has been completely restructured in the update sql scripts 4.0.0-2018-07-29.sql
, the schema changes made by this PR are made in these update sql scripts, and because the tables modified by this PR are cleared in these scripts, there is no need to update any old data.
Note on updating old 4.0 sql update scripts
Since we are not in Beta phase yet and so don't have to support updates from 4.0-Alpha-x to 4.0-Alpha-y or between nightly builds, we can change the existing 4.0 update scripts (but of course not pre-4.0 scripts). Later when in beta this will not be allowed anymore because we have to support updating from Beta-x to Beta-y (with y > x of course), so now is a good time to fix them.
Furthermore it makes sense to keep the schema updates for the datetime columns of each table together in one script, because on MySQL it might be necessary to combine all changes for a particular table into 1 single ALTER TABLE
statement in order to run properly in strict mode (i.e. strict tables enabled). Currently the db checker/fixer can't understand such statements, but it might be necessary to teach that tool soon to do that.
That's why this PR updates the existing sql update script and doesn't create a new one.
New Installation
configuration.php
and delete all Joomla database tables in PhpMyAdmin or PhpPgAdmin (depending on your database type).datetime
/timestamp without timezone
columns.Update from 3.9.12 or staging
datetime
/timestamp without timezone
columns.New Installation
Smart search works as well as without this PR. There are no datetime columns having value '0000-00-00 00:00:00' in any of the tables #__finder_filters
and #__finder_links
on MySQL', and there is no invalid default value anymore in MySQL >= 5.7 with strict mode on, and on PostgreSQL there are no values '1970-01-01 00:00:00'.
There is one exception: When checking in a finder filter using com_checkin, the checked_out_time
is set to '0000-00-00 00:00:00' on MySQL and '1970-01-01 00:00:00' on PosgreSQL. This will be changed with a separate, future PR for com_checkin. Checking in an item with the lock icon in list display works, i.e. there checked_out_time
is set to NULL.
On PostgreSQL there are issues which seem not to be related to this PR, e.g. "ERROR: invalid input syntax for type bytea at character 101". Such an error has been fixed once with PR #25884 by @alikon for com_finder, but now it seems to be back for some reason. @alikon Could you check?
Update from 3.9.12 or staging
Update works, no errors in SQL or PHP about smart search. Rest see above for new installation.
New Installation
Same as expected result, but the default value of these database column is invalid in MySQL >= 5.7 with strict mode on, and there might be values of '0000-00-00 00:00:00' on MySQL and '1970-01-01 00:00:00' on PostgreSQL in the datetime/timestamp columns of tables #__finder_filters
and #__finder_links
.
Update from 3.9.12 or staging
See new installation.
Maybe core developer docs and extension developer docs should be updated to encourage them not to use '0000-00-00 00:00:00' on MySQL anymore but use real NULL and not abuse '1970-01-01 00:00:00' on PostgreSQL as a speudo null date anymore and use real NULL values also there.
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin Postgresql Installation |
Labels |
Added:
?
|
Category | SQL Administration com_admin Postgresql Installation | ⇒ | SQL Administration com_admin Postgresql com_finder Front End Installation |
Title |
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-10-13 21:54:38 |
Closed_By | ⇒ | wilsonge |
Thanks!
Thanks too.
On PostgreSQL there are issues which seem not to be related to this PR, e.g. "ERROR: invalid input syntax for type bytea at character 101". Such an error has been fixed once with PR #25884 by @alikon for com_finder, but now it seems to be back for some reason. @alikon Could you check?