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":1133.5,"ttfb":309.6000003814697,"pageVisibility":"visible","entityId":26311,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"9f3703cf-5e11-4f81-ac1a-b873367894ec","navigationType":0,"readyForUser":1224.3000001907349,"redirectCount":0,"resourceLoadedEnd":883.4000005722046,"resourceLoadedStart":318.30000019073486,"resourceTiming":[{"duration":159.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":318.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":318.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":478,"responseStart":0,"secureConnectionStart":0},{"duration":159.89999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":318.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":318.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":478.5,"responseStart":0,"secureConnectionStart":0},{"duration":363.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":318.80000019073486,"connectEnd":318.80000019073486,"connectStart":318.80000019073486,"domainLookupEnd":318.80000019073486,"domainLookupStart":318.80000019073486,"fetchStart":318.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":481.5,"responseEnd":682.6000003814697,"responseStart":522.1000003814697,"secureConnectionStart":318.80000019073486},{"duration":497.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":318.9000005722046,"connectEnd":318.9000005722046,"connectStart":318.9000005722046,"domainLookupEnd":318.9000005722046,"domainLookupStart":318.9000005722046,"fetchStart":318.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":483.80000019073486,"responseEnd":816.7000007629395,"responseStart":518,"secureConnectionStart":318.9000005722046},{"duration":208.5999994277954,"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":319.20000076293945,"connectEnd":319.20000076293945,"connectStart":319.20000076293945,"domainLookupEnd":319.20000076293945,"domainLookupStart":319.20000076293945,"fetchStart":319.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":486,"responseEnd":527.8000001907349,"responseStart":523.2000007629395,"secureConnectionStart":319.20000076293945},{"duration":208.89999961853027,"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":319.4000005722046,"connectEnd":319.4000005722046,"connectStart":319.4000005722046,"domainLookupEnd":319.4000005722046,"domainLookupStart":319.4000005722046,"fetchStart":319.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":486.70000076293945,"responseEnd":528.3000001907349,"responseStart":524.4000005722046,"secureConnectionStart":319.4000005722046},{"duration":209.79999923706055,"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":319.70000076293945,"connectEnd":319.70000076293945,"connectStart":319.70000076293945,"domainLookupEnd":319.70000076293945,"domainLookupStart":319.70000076293945,"fetchStart":319.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":486.80000019073486,"responseEnd":529.5,"responseStart":525.1000003814697,"secureConnectionStart":319.70000076293945},{"duration":165.30000019073486,"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":319.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":319.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":485.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":236.10000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":320,"connectEnd":320,"connectStart":320,"domainLookupEnd":320,"domainLookupStart":320,"fetchStart":320,"redirectEnd":0,"redirectStart":0,"requestStart":501.4000005722046,"responseEnd":556.1000003814697,"responseStart":554.7000007629395,"secureConnectionStart":320},{"duration":165.80000019073486,"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":320.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":320.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":485.9000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":213.0999994277954,"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":320.4000005722046,"connectEnd":320.4000005722046,"connectStart":320.4000005722046,"domainLookupEnd":320.4000005722046,"domainLookupStart":320.4000005722046,"fetchStart":320.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":502.6000003814697,"responseEnd":533.5,"responseStart":530.5,"secureConnectionStart":320.4000005722046},{"duration":483.3999996185303,"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":321.20000076293945,"connectEnd":321.20000076293945,"connectStart":321.20000076293945,"domainLookupEnd":321.20000076293945,"domainLookupStart":321.20000076293945,"fetchStart":321.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":652.5,"responseEnd":804.6000003814697,"responseStart":800,"secureConnectionStart":321.20000076293945},{"duration":562.1999998092651,"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":321.20000076293945,"connectEnd":321.20000076293945,"connectStart":321.20000076293945,"domainLookupEnd":321.20000076293945,"domainLookupStart":321.20000076293945,"fetchStart":321.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":870.5,"responseEnd":883.4000005722046,"responseStart":882.6000003814697,"secureConnectionStart":321.20000076293945},{"duration":205.4000005722046,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":824.5,"connectEnd":824.5,"connectStart":824.5,"domainLookupEnd":824.5,"domainLookupStart":824.5,"fetchStart":824.5,"redirectEnd":0,"redirectStart":0,"requestStart":998.5,"responseEnd":1029.9000005722046,"responseStart":1029.1000003814697,"secureConnectionStart":824.5},{"duration":295.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1067.8000001907349,"connectEnd":1067.8000001907349,"connectStart":1067.8000001907349,"domainLookupEnd":1067.8000001907349,"domainLookupStart":1067.8000001907349,"fetchStart":1067.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1330.1000003814697,"responseEnd":1363,"responseStart":1361.2000007629395,"secureConnectionStart":1067.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":136,"responseStart":310,"responseEnd":316,"domLoading":313,"domInteractive":1323,"domContentLoadedEventStart":1323,"domContentLoadedEventEnd":1373,"domComplete":1759,"loadEventStart":1759,"loadEventEnd":1759,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1304.1000003814697},{"name":"bigPipe.sidebar-id.end","time":1304.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1305},{"name":"bigPipe.activity-panel-pipe-id.end","time":1305.8000001907349},{"name":"activityTabFullyLoaded","time":1392}],"measures":[],"correlationId":"af0199f10b30ae","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":10,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Pushed into MariaDB-10.0.6