User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This PR fixes all datetime columns of the com_workflow
component's database 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.
In opposite to PR #26372 , this PR here does not depend on PR #26295 , because this one here does not have anything to change in table #__ucm_content
.
Following is done for following tables:
#__workflows
: The 2 not nullable columns created
and modified
will be handled like the same columns of the #__banners
table in PR #26372 , i.e. they will get no default value. The default value is only used when inserting new records without specifying values for that particular column. Not having a default will enforce to insert new records with values for these columns being provided and throw an SQL error if some of these values is not specified, i.e. such errors will not be hidden anymore.#__workflows
, #__workflow_stages
and #__workflow_transitions
: The checked_out_time
columns added to these table with PR #24059 are made nullable.Because com_wokflow
and its table have been added in 4.0, there is no update for any old records in any sql update script, and because 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 don't need such update statements.
Therefore it is possible just to change the sql update scripts 4.0.0-2018-06-03.sql
which add the new table, what this PR does.
PHP code is changed so that the tables #__workflows
, #__workflow_stages
and #__workflow_transitions
support null values.
Finally, this PR fixes a bug in the update sql script 4.0.0-2018-05-15.sql
for postgresql, where columns checked_out_time
and checked_out
missing in the columns list for the insert statements for tables #__workflow_stages
and #__workflow_transitions
, but the values where in the statement's values list, which would result in an SQL error. The MySQL update sql script was ok regarding this issue.
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
Workflows work as well as without this PR. In a MySQL database there are no columns created
or modified
or checked_out_time
having value '0000-00-00 00:00:00' in any of the tables #__workflows
, #__workflow_stages
and #__workflow_transitions
, and there is no invalid default value anymore in MySQL >= 5.7 with strict mode on.
Update from 3.9.12 or staging
Update works, no errors in SQL or PHP about workflows. 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.
Update from 3.9.12 or staging
On MySQL same as expected, on PostgreSQL the update fails due to an SQL error when inserting the standard workflow (fixed here for new installs but not for the update: 81d0526), and later other errors related to workflows appear.
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_workflow Installation |
Title |
|
@alikon @Quy @SharkyKZ @twister65 Could you test this? I've just updated the testing instructions for testing the update path, too. Beside the datetime stuff this PR fixes an error in the update sql for workflows for postgresql, which makes update on postgresql fail. Since this PR does not require PR #26295 , but the update test of PR #26295 fails due to the error fixed here, please test this PR here first, if possible also with PostgreSQL, so we get this here merged soon and @wilsonge can update then his PR #26295 to latest 4.0-dev .
I have tested this item
I have tested this item
unfortunately tested on mysql 8.0.16-0ubuntu3 only (this time)
i swear if some glitch will arise on postgresql ... i'll be there to sort out
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-10-03 15:14:17 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thanks!
Ready for review and test.
@wilsonge Please review.