User tests: Successful: Unsuccessful:
Pull Request for Issue #27032 (comment).
See also #27032 (comment).
On J 3.9 and 3.10, the column core_checked_out_time
of database table #__ucm_content
has data type varchar(255)
and not datetime
like it should be in MySQL databases, see here: https://github.com/joomla/joomla-cms/blob/staging/installation/sql/mysql/joomla.sql#L1883.
On PostgreSQL it already has the right data type timestamp without time zone
, see here: https://github.com/joomla/joomla-cms/blob/staging/installation/sql/postgresql/joomla.sql#L1851.
When a current staging or 3.9.x or 3.10 is installed with English testing sampla date, records are added to table #__ucm_content
with value ''
(empty sting) for column core_checked_out_time
on MySQL.
This makes the following SQL statement to convert the database column to datetime
data type fail on certain MySQL databases (5.7 and later with default settings, e.g. some strict modes on): https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-01.sql#L6.
This PR here adds before the failing statement an update statement which changes an empty string to a sting literal for the (old) MySQL null date, so when converting the column to datetime
the string will be converted correctly.
The old null date is then later converted correctly to a real null value here: https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-14.sql#L24-L26.
One may say maybe better fix the testing sample data installation, but there might be other sources where empty string values for the core_checked_out_time
might come from, and these also would be fixed by this PR here, so it makes sense, and testing sample data might be fixed later independently of this PR.
In backend, go to Global Configuration, tab "Server", and set error reporting to "Maximum" or "Development".
Download the Joomla 4 nightly build update package "Joomla_4.0.0-beta1-dev-Development-Update_Package.zip" from here: https://developer.joomla.org/nightly-builds.html.
Update your installation to 4.0-beta1-dev using the Joomla Update Component's "Upload & Update" tab, uploading the zip package downloaded before in step 3.
At the end of the update, login to the backend.
Result: See section "Actual result" below.
Result: See section "Expected result" below.
Update finishs without SQL error.
There might be many untranslated language strings shown, but this is not related to this PR here, it happens also with the regular, i.e. unmodified update package from last nightly build.
After the first login to backend after end of the update:
But there is no further hint in PHP error log or the MySQL log file about the source of this error.
There might be many untranslated language strings shown, but this is a separate issue not related to the issue handled by this PR here.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin |
Title |
|
Labels |
Added:
?
|
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-12-09 11:09:18 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
Thanks
Thanks, too.
I have tested this item✅ successfully on 7be914e
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27228.