[4.0] Fix wrong table name "#__ucm_history" in utf8mb4 conversion SQL script#30227
Merged
Quy merged 1 commit intojoomla:4.0-devfrom Aug 1, 2020
Merged
Conversation
Contributor
|
I have tested this item ✅ successfully on 9712037 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30227. |
1 similar comment
Contributor
|
I have tested this item ✅ successfully on 9712037 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30227. |
Contributor
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30227. |
Member
Author
|
Thanks guys for testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue #30224 .
This pull request is not relevant for installations with a PostgreSQL database. It only applies to MySQL (or MariaDB).
Summary of Changes
With Pull Request (PR) #29217 , the
#__ucm_historydatabase table has been renamed to#__history.But it was forgotten to do this change in the utf8mb4 conversion SQL script.
This causes an update from 3.10 to 4 with utf8mb4 conversion to fail with an SQL error.
This PR here corrects this.
Due to the minimum database server version requirement we can be sure that J4 runs on a database which supports utf8mb4.
But the utf8mb4 conversion is still needed in J4 for following scenario:
Testing Instructions
Preparation
On a clean installation of Joomla 3.10 (latest nightly or Alpha 1 or current 3.10-dev branch) using a MySQL or MariaDB database, login to database using a tool like e.g. phpMyAdmin, and issue following SQL statement, replacing
#__by your database table prefix:This will simulate the situation that a database server of a J 3.10 has been updated from an old version which did not support utf8mb4 to a newer version which does that and fulfills the version requirements of J4, or migrates the database from an old server to a new server with the same result.
Go to Global Configuration and set error reporting to "Maximum" in the server settings.
Go to "Extensions -> Manage -> Database" and check if there are database problems, but DO NOT USE THE FIX BUTTON!!!
Result: 1 database problem "The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4).".

Make a complete backup, i.e. files and database, so you can later restore the starting point for test 2 after having done test 1.
Test 1: Reproduce the issue
Update a Joomla 3.10 which has been prepared as described above in section "Preparation" to the latest Joomla 4 nightly build.
If you can use the Live Update, change the update Channel to "Custom URL" and enter the following URL in the Joomla Update component's options: https://update.joomla.org/core/nightlies/next_major_list.xml.
I you can't use the Live Update for some reason, download the update package from the following link and use "Upload & Update": https://developer.joomla.org/nightlies/Joomla_4.0.0-beta4-dev-Development-Update_Package.zip.
Hint: The error alert "The template for this display is not available." shown during the update when having to log in is a know issue and can be ignored.
Result: See section "Actual result BEFORE applying this Pull Request" below.
Test 2: Test the fix of this PR
Same as before, but this time you update the prepared 3.10 to latest 4.0-dev plus the patch of this PR applied.
For this you either use the Live Update with custom URL https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/30227/downloads/34309/pr_list.xml, or use the "Upload & Update" and download the update package for this PR from https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/30227/downloads/34309/Joomla_4.0.0-beta4-dev+pr.30227-Development-Update_Package.zip.
Use a tool like e.g. phpMyAdmin to check collation of core database tables.
Result: See section "Expected result AFTER applying this Pull Request" below.
Actual result BEFORE applying this Pull Request
The update fails with an SQL error about not existing table

#__ucm_history(replace#__by your database prefix). See issue #30224 .In "System -> Information -> Database" (which was "Extensions -> Manage -> Database" in J3):

Using the "Update Structure" button (formerly called "Fix" in J3) does not change anything.
Expected result AFTER applying this Pull Request
The update ends with success.

The error alert "The template for this display is not available." is a know issue and can be ignored. It will disappear and never appear again after first navigating in the backend.
In "System -> Information -> Database" (which was "Extensions -> Manage -> Database" in J3):

The error about not matching version numbers is normal when using an update package which has been automatically build for a PR. It can be ignored, but it also can be fixed with the "Update Structure" button because that looks nicer at the end.
In database all core tables have collation
utf8mb4_unicode_ci.Documentation Changes Required
None.