Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.7(EOL) , 10.8(EOL)
I create a table with two similar ENUM columns, both using CHARACTER SET utf32:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
c1 ENUM ( 'a' , 'b' ) CHARACTER SET utf32 DEFAULT 'a' ,
c2 ENUM ( 'a' , 'b' ) CHARACTER SET utf32 DEFAULT 'a'
);
SHOW CREATE TABLE t1;
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` enum('??','??') CHARACTER SET utf32 DEFAULT '??',
`c2` enum('??','??') CHARACTER SET utf32 DEFAULT '??'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Notice, the SHOW CREATE returns garbage instead of ENUM values.
The problem happens in this piece of the code in table.cc:
if (interval_nr && charset->mbminlen > 1)
{
/* Unescape UCS2 intervals from HEX notation */
TYPELIB *interval= share->intervals + interval_nr - 1;
unhex_type2(interval);
As the two TYPELIBs are equal, only one copy of this TYPELIB is stored in the FRM file. But unhex_type() is called two times.
Note, TYPELIBs for tricky character sets like utf32 are stored in HEX notation. So the same problem is repeatable if I use a latin1 ENUM column whose values are equal to HEX representations of the utf32 ENUM column:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
c1 ENUM ( '00000061' , '00000062' ) DEFAULT '00000061' COLLATE latin1_bin,
c2 ENUM ( 'a' , 'b' ) DEFAULT 'a' COLLATE utf32_general_ci
);
SHOW CREATE TABLE t1;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` enum('\0\0\0a','\0\0\0b') CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '\0\0\0a',
`c2` enum('a','b') CHARACTER SET utf32 DEFAULT 'a'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
As in the previous example, only one copy of the TYPELIB is stored in the frm file (because they are binary equal).
But the unhex_type2() is called for this TYPELIB to unescape the utf32 column value. But the latin1 columns points to the same TYPELIB.
{"report":{"fcp":1020.5,"ttfb":233.4000005722046,"pageVisibility":"visible","entityId":108854,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"035c35f0-6048-4c92-adf7-27bef31b7334","navigationType":0,"readyForUser":1113.9000005722046,"redirectCount":0,"resourceLoadedEnd":759.4000005722046,"resourceLoadedStart":239.4000005722046,"resourceTiming":[{"duration":53.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":239.4000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":239.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":293.20000076293945,"responseStart":0,"secureConnectionStart":0},{"duration":53.89999961853027,"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":239.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":239.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":293.5,"responseStart":0,"secureConnectionStart":0},{"duration":320.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":239.80000019073486,"connectEnd":239.80000019073486,"connectStart":239.80000019073486,"domainLookupEnd":239.80000019073486,"domainLookupStart":239.80000019073486,"fetchStart":239.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":296.5,"responseEnd":560,"responseStart":335.5,"secureConnectionStart":239.80000019073486},{"duration":447.9000005722046,"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":240,"connectEnd":240,"connectStart":240,"domainLookupEnd":240,"domainLookupStart":240,"fetchStart":240,"redirectEnd":0,"redirectStart":0,"requestStart":303.4000005722046,"responseEnd":687.9000005722046,"responseStart":338.9000005722046,"secureConnectionStart":240},{"duration":96.69999980926514,"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":240.10000038146973,"connectEnd":240.10000038146973,"connectStart":240.10000038146973,"domainLookupEnd":240.10000038146973,"domainLookupStart":240.10000038146973,"fetchStart":240.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":303.9000005722046,"responseEnd":336.80000019073486,"responseStart":332.9000005722046,"secureConnectionStart":240.10000038146973},{"duration":96.69999980926514,"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":240.30000019073486,"connectEnd":240.30000019073486,"connectStart":240.30000019073486,"domainLookupEnd":240.30000019073486,"domainLookupStart":240.30000019073486,"fetchStart":240.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":304,"responseEnd":337,"responseStart":333.70000076293945,"secureConnectionStart":240.30000019073486},{"duration":96.80000019073486,"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":240.4000005722046,"connectEnd":240.4000005722046,"connectStart":240.4000005722046,"domainLookupEnd":240.4000005722046,"domainLookupStart":240.4000005722046,"fetchStart":240.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":304.30000019073486,"responseEnd":337.20000076293945,"responseStart":334.5,"secureConnectionStart":240.4000005722046},{"duration":62.59999942779541,"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":240.70000076293945,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":240.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":303.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":96.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":240.9000005722046,"connectEnd":240.9000005722046,"connectStart":240.9000005722046,"domainLookupEnd":240.9000005722046,"domainLookupStart":240.9000005722046,"fetchStart":240.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":307.1000003814697,"responseEnd":337.4000005722046,"responseStart":334.9000005722046,"secureConnectionStart":240.9000005722046},{"duration":64.30000019073486,"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":241,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":305.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":115.69999980926514,"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":241.20000076293945,"connectEnd":241.20000076293945,"connectStart":241.20000076293945,"domainLookupEnd":241.20000076293945,"domainLookupStart":241.20000076293945,"fetchStart":241.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":327.5,"responseEnd":356.9000005722046,"responseStart":355.20000076293945,"secureConnectionStart":241.20000076293945},{"duration":502.70000076293945,"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":247,"connectEnd":247,"connectStart":247,"domainLookupEnd":247,"domainLookupStart":247,"fetchStart":247,"redirectEnd":0,"redirectStart":0,"requestStart":442.20000076293945,"responseEnd":749.7000007629395,"responseStart":743.3000001907349,"secureConnectionStart":247},{"duration":512.4000005722046,"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":247,"connectEnd":247,"connectStart":247,"domainLookupEnd":247,"domainLookupStart":247,"fetchStart":247,"redirectEnd":0,"redirectStart":0,"requestStart":363.20000076293945,"responseEnd":759.4000005722046,"responseStart":758.4000005722046,"secureConnectionStart":247},{"duration":125,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":690.4000005722046,"connectEnd":690.4000005722046,"connectStart":690.4000005722046,"domainLookupEnd":690.4000005722046,"domainLookupStart":690.4000005722046,"fetchStart":690.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":773.1000003814697,"responseEnd":815.4000005722046,"responseStart":814,"secureConnectionStart":690.4000005722046},{"duration":260.6000003814697,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":931,"connectEnd":931,"connectStart":931,"domainLookupEnd":931,"domainLookupStart":931,"fetchStart":931,"redirectEnd":0,"redirectStart":0,"requestStart":1157.9000005722046,"responseEnd":1191.6000003814697,"responseStart":1190.8000001907349,"secureConnectionStart":931}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":42,"responseStart":234,"responseEnd":243,"domLoading":238,"domInteractive":1175,"domContentLoadedEventStart":1175,"domContentLoadedEventEnd":1220,"domComplete":1715,"loadEventStart":1715,"loadEventEnd":1715,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1155.7000007629395},{"name":"bigPipe.sidebar-id.end","time":1156.4000005722046},{"name":"bigPipe.activity-panel-pipe-id.start","time":1156.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":1157.7000007629395},{"name":"activityTabFullyLoaded","time":1242.4000005722046}],"measures":[],"correlationId":"fe5db1b2a071df","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
discussed on slack.