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":919.4000000059605,"ttfb":163.70000000298023,"pageVisibility":"visible","entityId":108854,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"06fec446-0809-481e-813f-7d7a79762610","navigationType":0,"readyForUser":1010.7999999970198,"redirectCount":0,"resourceLoadedEnd":1365.5,"resourceLoadedStart":168.70000000298023,"resourceTiming":[{"duration":271.90000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":168.70000000298023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":168.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":440.6000000089407,"responseStart":0,"secureConnectionStart":0},{"duration":271.79999999701977,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":169,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":169,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":440.79999999701977,"responseStart":0,"secureConnectionStart":0},{"duration":281,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":169.1000000089407,"connectEnd":169.1000000089407,"connectStart":169.1000000089407,"domainLookupEnd":169.1000000089407,"domainLookupStart":169.1000000089407,"fetchStart":169.1000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":169.1000000089407,"responseEnd":450.1000000089407,"responseStart":450.1000000089407,"secureConnectionStart":169.1000000089407},{"duration":333.70000000298023,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":169.29999999701977,"connectEnd":169.29999999701977,"connectStart":169.29999999701977,"domainLookupEnd":169.29999999701977,"domainLookupStart":169.29999999701977,"fetchStart":169.29999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":169.29999999701977,"responseEnd":503,"responseStart":503,"secureConnectionStart":169.29999999701977},{"duration":337.1000000089407,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":169.5,"connectEnd":169.5,"connectStart":169.5,"domainLookupEnd":169.5,"domainLookupStart":169.5,"fetchStart":169.5,"redirectEnd":0,"redirectStart":0,"requestStart":169.5,"responseEnd":506.6000000089407,"responseStart":506.6000000089407,"secureConnectionStart":169.5},{"duration":337.40000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":169.70000000298023,"connectEnd":169.70000000298023,"connectStart":169.70000000298023,"domainLookupEnd":169.70000000298023,"domainLookupStart":169.70000000298023,"fetchStart":169.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":169.70000000298023,"responseEnd":507.1000000089407,"responseStart":507.1000000089407,"secureConnectionStart":169.70000000298023},{"duration":337.70000000298023,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":169.79999999701977,"connectEnd":169.79999999701977,"connectStart":169.79999999701977,"domainLookupEnd":169.79999999701977,"domainLookupStart":169.79999999701977,"fetchStart":169.79999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":169.79999999701977,"responseEnd":507.5,"responseStart":507.5,"secureConnectionStart":169.79999999701977},{"duration":424.69999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":170.1000000089407,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.1000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":594.7999999970198,"responseStart":0,"secureConnectionStart":0},{"duration":337.70000000298023,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":170.20000000298023,"connectEnd":170.20000000298023,"connectStart":170.20000000298023,"domainLookupEnd":170.20000000298023,"domainLookupStart":170.20000000298023,"fetchStart":170.20000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":170.20000000298023,"responseEnd":507.90000000596046,"responseStart":507.90000000596046,"secureConnectionStart":170.20000000298023},{"duration":424.40000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":170.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":594.9000000059605,"responseStart":0,"secureConnectionStart":0},{"duration":338,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":170.5,"connectEnd":170.5,"connectStart":170.5,"domainLookupEnd":170.5,"domainLookupStart":170.5,"fetchStart":170.5,"redirectEnd":0,"redirectStart":0,"requestStart":170.5,"responseEnd":508.5,"responseStart":508.5,"secureConnectionStart":170.5},{"duration":687.1000000089407,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":176.79999999701977,"connectEnd":176.79999999701977,"connectStart":176.79999999701977,"domainLookupEnd":176.79999999701977,"domainLookupStart":176.79999999701977,"fetchStart":176.79999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":176.79999999701977,"responseEnd":863.9000000059605,"responseStart":863.9000000059605,"secureConnectionStart":176.79999999701977},{"duration":1188.5999999940395,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":176.90000000596046,"connectEnd":176.90000000596046,"connectStart":176.90000000596046,"domainLookupEnd":176.90000000596046,"domainLookupStart":176.90000000596046,"fetchStart":176.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":176.90000000596046,"responseEnd":1365.5,"responseStart":1365.5,"secureConnectionStart":176.90000000596046},{"duration":263.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":606.5,"connectEnd":606.5,"connectStart":606.5,"domainLookupEnd":606.5,"domainLookupStart":606.5,"fetchStart":606.5,"redirectEnd":0,"redirectStart":0,"requestStart":606.5,"responseEnd":870,"responseStart":870,"secureConnectionStart":606.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":8,"responseStart":164,"responseEnd":176,"domLoading":167,"domInteractive":1384,"domContentLoadedEventStart":1384,"domContentLoadedEventEnd":1427,"domComplete":2620,"loadEventStart":2620,"loadEventEnd":2622,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1367.2000000029802},{"name":"bigPipe.sidebar-id.end","time":1368},{"name":"bigPipe.activity-panel-pipe-id.start","time":1368.2000000029802},{"name":"bigPipe.activity-panel-pipe-id.end","time":1370.4000000059605},{"name":"activityTabFullyLoaded","time":1433.7000000029802}],"measures":[],"correlationId":"d32b04cebba951","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}