There are incompatibilities between some MariaDB and MySQL collations
which we need to solve somehow.
Problems
1.
The utf8_croatian_ci and ucs2_croatian_ci collations appeared in MariaDB-5.1 in the end of 2009, based on Alexander Barkov's patch from: http://collation-charts.org/articles/croatian.htm
Later, the Croatian collations were added into MySQL-5.6.
Still, MariaDB Croatian collation uses the latest version of the rules from http://unicode.org/cldr/trac/browser/trunk/common/collation/hr.xml while MySQL implements the older version.
The difference is in 3 letters only. But it's enough to make the indexes incompatible.
As a effect:
- utf8_croatian_ci (ID 213) is different in MariaDB and MySQL
- ucs2_croatian_ci (ID 149) is different in MariaDB and MySQL
2.
Later, MySQL-5.5 added support for utf8mb4, utf16, utf32. When merging the new character sets (MySQL-5.5 -> MariaDB-5.5) the MariaDB team added the following corresponding collations, for symmetry with utf8 and ucs2:
- utf8mb4_croatian_ci (ID=245)
- utf16_croatian_ci (ID=215)
- utf32_croatian_ci (ID=214)
But when the collations with the same names finally appeared in MySQL-5.6, they were given different IDs. So the IDs 215, 215, 245 are assigned in MySQL-5.6 to something else.
This is what we have in MariaDB:
mysql> SELECT COLLATION_NAME, ID FROM INFORMATION_SCHEMA.COLLATIONS
|
--> WHERE COLLATION_NAME LIKE 'u%croat%';
|
+---------------------+-----+
|
| COLLATION_NAME | ID |
|
+---------------------+-----+
|
| ucs2_croatian_ci | 149 |
|
| utf8_croatian_ci | 213 |
|
| utf32_croatian_ci | 214 |
|
| utf16_croatian_ci | 215 |
|
| utf8mb4_croatian_ci | 245 |
|
+---------------------+-----+
|
5 rows in set (0.01 sec)
|
This is what we have in MySQL-5.6:
mysql> SELECT COLLATION_NAME, ID FROM INFORMATION_SCHEMA.COLLATIONS
|
--> WHERE ID IN (149,213,214,215,245);
|
+---------------------+-----+
|
| COLLATION_NAME | ID | Problem:
|
+---------------------+-----+
|
| ucs2_croatian_ci | 149 | MySQL rules differ from MariaDB rules
|
| utf8_croatian_ci | 213 | MySQL rules differ from MariaDB rules
|
| utf8_unicode_520_ci | 214 | MariaDB utf32_croatian_ci
|
| utf8_vietnamese_ci | 215 | MariaDB utf16_croatian_ci
|
| utf8mb4_croatian_ci | 245 | MySQL rules differ from MariaDB rules
|
+---------------------+-----+
|
Solution
Collation changes
- Bar moves MariaDB-5.5 xxx_croatian_ci collations to new IDs (preferrably, outside of the 0..255 range), without changing the collation name.
- Bar merges MySQL-5.6 xxx_croatian_ci using MySQL-5.6 IDs, but changing the names to xxx_croatian_mysql56_ci.
Detect attempts to open tables with the old MariaDB collations.
Bar fixes TABLE_SHARE::init_from_binary_frm_image() and adds an error message for a table created by any MariaDB version prior to 10.0.5 that have indexes using collation IDs 213, 149, 245, 215, 214:
+---------------------+---------+-----+---------+----------+---------+
|
| Collation | Charset | Id | Default | Compiled | Sortlen |
|
+---------------------+---------+-----+---------+----------+---------+
|
| utf8_croatian_ci | utf8 | 213 | | Yes | 8 |
|
| ucs2_croatian_ci | ucs2 | 149 | | Yes | 8 |
|
| utf8mb4_croatian_ci | utf8mb4 | 245 | | Yes | 8 |
|
| utf16_croatian_ci | utf16 | 215 | | Yes | 8 |
|
| utf32_croatian_ci | utf32 | 214 | | Yes | 8 |
|
+---------------------+---------+-----+---------+----------+---------+
|
ER_TABLE_NEEDS_UPGRADE looks suitable for this purposes:
"Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" or dump/reload to fix it!"
|
mysql_upgrade
Monty will try to fix REPAIR to solve the conflicting IDs problem.
quick REPAIR
In long terms we can add a quick REPAIR to replace collation IDs in table definitions in FRM files and in engine-specific structure definitions (e.g. in MYI files for MyISAM) without having to do the full repair for the table.
- relates to
-
MDEV-16945
main.ctype_upgrade failed in buildbot, error upon mysql_upgrade
-
-
Open
{"report":{"fcp":1723.8000001907349,"ttfb":520,"pageVisibility":"visible","entityId":26311,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"494d0722-7cae-42e9-b185-52d69237b6f4","navigationType":0,"readyForUser":1800.5,"redirectCount":0,"resourceLoadedEnd":2367.9000000953674,"resourceLoadedStart":527.5,"resourceTiming":[{"duration":608.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":527.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":527.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1136,"responseStart":0,"secureConnectionStart":0},{"duration":608.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":527.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":527.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1136.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":656.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":527.9000000953674,"connectEnd":527.9000000953674,"connectStart":527.9000000953674,"domainLookupEnd":527.9000000953674,"domainLookupStart":527.9000000953674,"fetchStart":527.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":527.9000000953674,"responseEnd":1184.5,"responseStart":1184.5,"secureConnectionStart":527.9000000953674},{"duration":745.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":528.2000000476837,"connectEnd":528.2000000476837,"connectStart":528.2000000476837,"domainLookupEnd":528.2000000476837,"domainLookupStart":528.2000000476837,"fetchStart":528.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":528.2000000476837,"responseEnd":1274,"responseStart":1274,"secureConnectionStart":528.2000000476837},{"duration":749.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":528.3000001907349,"connectEnd":528.3000001907349,"connectStart":528.3000001907349,"domainLookupEnd":528.3000001907349,"domainLookupStart":528.3000001907349,"fetchStart":528.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":528.3000001907349,"responseEnd":1278.1000001430511,"responseStart":1278.1000001430511,"secureConnectionStart":528.3000001907349},{"duration":750.1000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":528.5,"connectEnd":528.5,"connectStart":528.5,"domainLookupEnd":528.5,"domainLookupStart":528.5,"fetchStart":528.5,"redirectEnd":0,"redirectStart":0,"requestStart":528.5,"responseEnd":1278.6000001430511,"responseStart":1278.6000001430511,"secureConnectionStart":528.5},{"duration":750.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":528.6000001430511,"connectEnd":528.6000001430511,"connectStart":528.6000001430511,"domainLookupEnd":528.6000001430511,"domainLookupStart":528.6000001430511,"fetchStart":528.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":528.6000001430511,"responseEnd":1278.9000000953674,"responseStart":1278.9000000953674,"secureConnectionStart":528.6000001430511},{"duration":821.1999998092651,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":528.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":528.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1350,"responseStart":0,"secureConnectionStart":0},{"duration":750.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":529,"connectEnd":529,"connectStart":529,"domainLookupEnd":529,"domainLookupStart":529,"fetchStart":529,"redirectEnd":0,"redirectStart":0,"requestStart":529,"responseEnd":1279.5,"responseStart":1279.5,"secureConnectionStart":529},{"duration":820.9000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":529.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":529.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1350.1000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":750.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":529.4000000953674,"connectEnd":529.4000000953674,"connectStart":529.4000000953674,"domainLookupEnd":529.4000000953674,"domainLookupStart":529.4000000953674,"fetchStart":529.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":529.4000000953674,"responseEnd":1280.1000001430511,"responseStart":1280.1000001430511,"secureConnectionStart":529.4000000953674},{"duration":1441.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":541.4000000953674,"connectEnd":541.4000000953674,"connectStart":541.4000000953674,"domainLookupEnd":541.4000000953674,"domainLookupStart":541.4000000953674,"fetchStart":541.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":541.4000000953674,"responseEnd":1983.2000000476837,"responseStart":1983.2000000476837,"secureConnectionStart":541.4000000953674},{"duration":1826.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":541.4000000953674,"connectEnd":541.4000000953674,"connectStart":541.4000000953674,"domainLookupEnd":541.4000000953674,"domainLookupStart":541.4000000953674,"fetchStart":541.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":541.4000000953674,"responseEnd":2367.9000000953674,"responseStart":2367.9000000953674,"secureConnectionStart":541.4000000953674},{"duration":629.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1363.7000000476837,"connectEnd":1363.7000000476837,"connectStart":1363.7000000476837,"domainLookupEnd":1363.7000000476837,"domainLookupStart":1363.7000000476837,"fetchStart":1363.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1363.7000000476837,"responseEnd":1993.2000000476837,"responseStart":1993.2000000476837,"secureConnectionStart":1363.7000000476837},{"duration":747.5999999046326,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1688.3000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1688.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2435.9000000953674,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":357,"responseStart":520,"responseEnd":533,"domLoading":526,"domInteractive":2389,"domContentLoadedEventStart":2389,"domContentLoadedEventEnd":2433,"domComplete":3644,"loadEventStart":3644,"loadEventEnd":3645,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2372.800000190735},{"name":"bigPipe.sidebar-id.end","time":2373.600000143051},{"name":"bigPipe.activity-panel-pipe-id.start","time":2373.800000190735},{"name":"bigPipe.activity-panel-pipe-id.end","time":2376.300000190735},{"name":"activityTabFullyLoaded","time":2456.600000143051}],"measures":[],"correlationId":"9e96ec4d4b3397","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":100,"dbReadsTimeInMs":11,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}