DROP TABLE IF EXISTS t1;
|
DELIMITER $$
|
BEGIN NOT ATOMIC
|
DECLARE var TEXT CHARACTER SET utf8;
|
CREATE TABLE t1 AS SELECT var;
|
END;
|
$$
|
DELIMITER ;
|
SHOW CREATE TABLE t1;
|
+-------+---------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+---------------------------------------------------------------------------------------------------------------+
|
| t1 | CREATE TABLE `t1` (
|
`var` mediumtext CHARACTER SET utf8 DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+---------------------------------------------------------------------------------------------------------------+
|
Notice, the column data type in the table does not match the variable data type.
The expected data type for t1.var should be TEXT CHARACTER SET utf8 rather than MEDIUMTEXT CHARACTER SET utf8.
{"report":{"fcp":916.6999998092651,"ttfb":303.19999980926514,"pageVisibility":"visible","entityId":66989,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"65eb1681-7f95-48cc-8eb0-fbfb2d690a86","navigationType":0,"readyForUser":995.7999999523163,"redirectCount":0,"resourceLoadedEnd":948.8999998569489,"resourceLoadedStart":308.39999985694885,"resourceTiming":[{"duration":92.70000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":308.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":308.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":401.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":93.40000009536743,"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":308.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":308.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":150.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":308.7999999523163,"connectEnd":308.7999999523163,"connectStart":308.7999999523163,"domainLookupEnd":308.7999999523163,"domainLookupStart":308.7999999523163,"fetchStart":308.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":308.7999999523163,"responseEnd":459.19999980926514,"responseStart":459.19999980926514,"secureConnectionStart":308.7999999523163},{"duration":216.59999990463257,"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":309,"connectEnd":309,"connectStart":309,"domainLookupEnd":309,"domainLookupStart":309,"fetchStart":309,"redirectEnd":0,"redirectStart":0,"requestStart":309,"responseEnd":525.5999999046326,"responseStart":525.5999999046326,"secureConnectionStart":309},{"duration":220.40000009536743,"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":309.19999980926514,"connectEnd":309.19999980926514,"connectStart":309.19999980926514,"domainLookupEnd":309.19999980926514,"domainLookupStart":309.19999980926514,"fetchStart":309.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":309.19999980926514,"responseEnd":529.5999999046326,"responseStart":529.5999999046326,"secureConnectionStart":309.19999980926514},{"duration":220.70000004768372,"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":309.39999985694885,"connectEnd":309.39999985694885,"connectStart":309.39999985694885,"domainLookupEnd":309.39999985694885,"domainLookupStart":309.39999985694885,"fetchStart":309.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":309.39999985694885,"responseEnd":530.0999999046326,"responseStart":530.0999999046326,"secureConnectionStart":309.39999985694885},{"duration":220.79999995231628,"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":309.59999990463257,"connectEnd":309.59999990463257,"connectStart":309.59999990463257,"domainLookupEnd":309.59999990463257,"domainLookupStart":309.59999990463257,"fetchStart":309.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":309.59999990463257,"responseEnd":530.3999998569489,"responseStart":530.3999998569489,"secureConnectionStart":309.59999990463257},{"duration":292.59999990463257,"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":309.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":309.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":602.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":220.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":310,"connectEnd":310,"connectStart":310,"domainLookupEnd":310,"domainLookupStart":310,"fetchStart":310,"redirectEnd":0,"redirectStart":0,"requestStart":310,"responseEnd":530.8999998569489,"responseStart":530.8999998569489,"secureConnectionStart":310},{"duration":292.40000009536743,"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":310.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":310.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":602.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":221.09999990463257,"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":310.2999999523163,"connectEnd":310.2999999523163,"connectStart":310.2999999523163,"domainLookupEnd":310.2999999523163,"domainLookupStart":310.2999999523163,"fetchStart":310.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":310.2999999523163,"responseEnd":531.3999998569489,"responseStart":531.3999998569489,"secureConnectionStart":310.2999999523163},{"duration":630.3000001907349,"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":316.19999980926514,"connectEnd":316.19999980926514,"connectStart":316.19999980926514,"domainLookupEnd":316.19999980926514,"domainLookupStart":316.19999980926514,"fetchStart":316.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":316.19999980926514,"responseEnd":946.5,"responseStart":946.5,"secureConnectionStart":316.19999980926514},{"duration":628.0999999046326,"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":320.7999999523163,"connectEnd":320.7999999523163,"connectStart":320.7999999523163,"domainLookupEnd":320.7999999523163,"domainLookupStart":320.7999999523163,"fetchStart":320.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":320.7999999523163,"responseEnd":948.8999998569489,"responseStart":948.8999998569489,"secureConnectionStart":320.7999999523163},{"duration":332.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":614.3999998569489,"connectEnd":614.3999998569489,"connectStart":614.3999998569489,"domainLookupEnd":614.3999998569489,"domainLookupStart":614.3999998569489,"fetchStart":614.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":614.3999998569489,"responseEnd":946.8999998569489,"responseStart":946.8999998569489,"secureConnectionStart":614.3999998569489},{"duration":180.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":910.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":910.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1091.0999999046326,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":83,"responseStart":303,"responseEnd":321,"domLoading":306,"domInteractive":1141,"domContentLoadedEventStart":1141,"domContentLoadedEventEnd":1190,"domComplete":1488,"loadEventStart":1488,"loadEventEnd":1488,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1100.2999999523163},{"name":"bigPipe.sidebar-id.end","time":1101},{"name":"bigPipe.activity-panel-pipe-id.start","time":1101.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1106.2999999523163},{"name":"activityTabFullyLoaded","time":1205.6999998092651}],"measures":[],"correlationId":"419ca3a00da5be","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":110,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The problem happens in adjust_max_effective_column_length(). It's supposed to adjust the maximum length for the integer data types according to their capacity (instead of the user-specified length), e.g. convert int(3) to int(11).
However, the code also erroneously adjusts the length for the blob data types, because their max_display_length() returns something bigger than max_length, which was previously set to char_length() by Type_std_attributes::set(). So later Type_handler::blob_type_handler() converts a wrong (too large) length to a wrong (longer) BLOB variant.
Another option would be to fix Item_splocal::create_field_for_create_select() from:
Field *create_field_for_create_select(TABLE *table)
to:
Field *create_field_for_create_select(TABLE *table)
This will make sure preserve the data type of the variable.