-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[3.x] Fix errors about int and tinyint columns shown in database schema check on MySQL 8 #28501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Fix errors about int and tinyint columns shown in database schema check on MySQL 8 #28501
Conversation
|
@alikon @brianteeman Could you test this one, too? Is same as #28370 for J4, but here for staging, and in opposite to the other one I had to handle tinyint columns here, soo, see the screenshot in the description. |
|
I have tested this item ✅ successfully on 19f3009 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28501. |
|
I've just adjusted the testing instructions so it doesn't need testers having both kinds of databases MySQL 8.0.19 to check that the PR solves the issue, and MySQL older than 8.0.19 or MariaDB to check that for these the PR doesn't create a new issue. Testers please report back with which version you have tested. At the end it will need 2 tests of each kind of the following 2 kinds:
|
|
I have tested this item ✅ successfully on 19f3009 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28501. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28501. |
|
Thanks |
|
While working on issue #32542 I've noticed that this PR here should have handled also the other integer data types and not only |
Pull Request for Issue #28367 .
Summary of Changes
This Pull Request (PR) changes the database schema checker for MySQL so that any display width is ignored for integer (
intortinyint) columns when checking these columns.The reason for this is that beginning with MySQL 8.0.19, the
typein aSHOW COLUMNSstatement doesn't include anymore the display width if the database has been created in that version, while on previous versions it is included. E.g. on MySQL 5.7 or 8.0.18 thetypevalue is "int(11)" or "int(10) unsigned" or "tinyint(3)" while on mySQL 8.0.19 it is just "int" or "int unsigned" or "tinyint".The display width doesn't have any impact on value range or storage size for an integer column, it only determines how a value would be left-padded with zeros if that would be done, but this padding is deprecated anyway. See https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html for details.
Testing Instructions
Requirements
Have a MySQL database with version 8.0.19 and another one with an older version, e.g. 5.7 or 8.0.18 or a MariaDB. If you don't have both but only one of these 2, report back with which version you have tested. At the end it needs each 2 tests for the following cases:
Instructions
Install a clean staging without the patch of this PR applied on MySQL 8.0.19, using a database which you have created on that database version or creating a new one during installation.
Then go to the database checker.
Result: You see errors about columns of type
int(11)andint(10)andtinyint(3)and similar. See section "Actual result" below.Now apply the patch of this PR and go again to the database checker or reload the page if still there.
Result: No errors are shown, see section "Expected result" below.
Now delete configuration.php and install the staging with the patch of this PR applied on a MySQL version prior to 8.0.19, e.g. 5.7 or 8.0.18.
Then go to the database checker.
Result: With this PR applied it works as before for MySQL prior to 8.0.19, i.e. there are no database errors after a clean install.
Expected result
All database table structures are up to date.
No problems were found.
Actual result
Using the "Fix" button does not fix these false errors.
Documentation Changes Required
None.
Additional information
I found following statement here https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html in section "Deprecation and Removal Notes":
For DESCRIBE statements and INFORMATION_SCHEMA queries, output is unaffected for objects created in previous MySQL 8.0 versions because information already stored in the data dictionary remains unchanged. This exception does not apply for upgrades from MySQL 5.7 to 8.0, for which all data dictionary information is re-created such that data type definitions do not include display width.I.e. if you have updated e.g. an 8.0.18 to an 8.0.19, previously present databases still will show the display width in their integer data types, and so you can't reproduce the issue. But as soon as using a newly created database, you can reproduce it.