Type:
Bug
Priority:
Blocker
Resolution:
Fixed
Affects Version/s:
10.6.9 , 10.7.5 , 10.8.4 , 10.9.2 , 10.10.1
The following change to a regression test will cause a crash:
diff --git a/mysql-test/suite/innodb/t/innodb-index-online.test b/mysql-test/suite/innodb/t/innodb-index-online.test
index 2cb84b18402..2f5926d3a53 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online.test
+++ b/mysql-test/suite/innodb/t/innodb-index-online.test
@@ -15,7 +15,8 @@ SET GLOBAL innodb_file_per_table = on;
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
-CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, c3 TEXT)
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT,
+c3 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin, INDEX c2c3(c2,c3))
ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t1 VALUES (1,1,''), (2,2,''), (3,3,''), (4,4,''), (5,5,'');
@@ -377,10 +378,11 @@ CHECK TABLE t1;
--error ER_DUP_ENTRY
ALTER TABLE t1 ADD UNIQUE INDEX c3p5(c3(5));
UPDATE t1 SET c3 = NULL WHERE c3 = '';
+ALTER TABLE t1 ADD UNIQUE INDEX c3p5(c3(5));
SET lock_wait_timeout = 1;
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c3p5_created WAIT_FOR ins_done';
--send
-ALTER TABLE t1 ADD UNIQUE INDEX c3p5(c3(5));
+ALTER TABLE t1 MODIFY c3 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR c3p5_created';
10.6 f410974f0f38999a08ad0d3f9c109ee184db7f31
CURRENT_TEST: innodb.innodb-index-online
mysqltest: At line 401: query 'reap' failed with wrong errno <Unknown> (2013): 'Lost connection to server during query', instead of ER_LOCK_WAIT_TIMEOUT (1205)...
…
mariadbd: /mariadb/10.6/storage/innobase/include/dict0mem.h:980: dict_col_t* dict_index_t::col_info::add(mem_heap_t*, const dict_col_t&, unsigned int): Assertion `offset < n_cols' failed.
The ha_innobase_inplace_ctx::cleanup_col_collation() is supposed to replace the column metadata for the second indexed column of the index c2c3 . Instead, it is replacing the metadata for the first (unchanged) column c2 and would then run out of elements when replacing c3 .
When I attempted to retain the TEXT type for the column, the test would hang. I did not investigate the reason.
{"report":{"fcp":794,"ttfb":156.69999998807907,"pageVisibility":"visible","entityId":114343,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"9ab44402-00f8-4c77-9b72-6fc2560a1439","navigationType":0,"readyForUser":873.3000000119209,"redirectCount":0,"resourceLoadedEnd":960.0999999940395,"resourceLoadedStart":161.5,"resourceTiming":[{"duration":154.69999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":161.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":161.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":316.19999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":154.69999998807907,"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":161.80000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":161.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":316.5,"responseStart":0,"secureConnectionStart":0},{"duration":163.2999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":161.90000000596046,"connectEnd":161.90000000596046,"connectStart":161.90000000596046,"domainLookupEnd":161.90000000596046,"domainLookupStart":161.90000000596046,"fetchStart":161.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":161.90000000596046,"responseEnd":325.19999998807907,"responseStart":325.19999998807907,"secureConnectionStart":161.90000000596046},{"duration":229.59999999403954,"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":162.09999999403954,"connectEnd":162.09999999403954,"connectStart":162.09999999403954,"domainLookupEnd":162.09999999403954,"domainLookupStart":162.09999999403954,"fetchStart":162.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":162.09999999403954,"responseEnd":391.69999998807907,"responseStart":391.69999998807907,"secureConnectionStart":162.09999999403954},{"duration":233.19999998807907,"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":162.30000001192093,"connectEnd":162.30000001192093,"connectStart":162.30000001192093,"domainLookupEnd":162.30000001192093,"domainLookupStart":162.30000001192093,"fetchStart":162.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":162.30000001192093,"responseEnd":395.5,"responseStart":395.5,"secureConnectionStart":162.30000001192093},{"duration":233.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":162.59999999403954,"connectEnd":162.59999999403954,"connectStart":162.59999999403954,"domainLookupEnd":162.59999999403954,"domainLookupStart":162.59999999403954,"fetchStart":162.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":162.59999999403954,"responseEnd":396,"responseStart":396,"secureConnectionStart":162.59999999403954},{"duration":233.59999999403954,"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":162.80000001192093,"connectEnd":162.80000001192093,"connectStart":162.80000001192093,"domainLookupEnd":162.80000001192093,"domainLookupStart":162.80000001192093,"fetchStart":162.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":162.80000001192093,"responseEnd":396.40000000596046,"responseStart":396.30000001192093,"secureConnectionStart":162.80000001192093},{"duration":304.40000000596046,"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":162.90000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":162.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":467.30000001192093,"responseStart":0,"secureConnectionStart":0},{"duration":233.7000000178814,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":163.09999999403954,"connectEnd":163.09999999403954,"connectStart":163.09999999403954,"domainLookupEnd":163.09999999403954,"domainLookupStart":163.09999999403954,"fetchStart":163.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":163.09999999403954,"responseEnd":396.80000001192093,"responseStart":396.80000001192093,"secureConnectionStart":163.09999999403954},{"duration":304.2000000178814,"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":163.19999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":163.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":467.40000000596046,"responseStart":0,"secureConnectionStart":0},{"duration":233.90000000596046,"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":163.40000000596046,"connectEnd":163.40000000596046,"connectStart":163.40000000596046,"domainLookupEnd":163.40000000596046,"domainLookupStart":163.40000000596046,"fetchStart":163.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":163.40000000596046,"responseEnd":397.30000001192093,"responseStart":397.30000001192093,"secureConnectionStart":163.40000000596046},{"duration":435.2000000178814,"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":168.69999998807907,"connectEnd":168.69999998807907,"connectStart":168.69999998807907,"domainLookupEnd":168.69999998807907,"domainLookupStart":168.69999998807907,"fetchStart":168.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":168.69999998807907,"responseEnd":603.9000000059605,"responseStart":603.9000000059605,"secureConnectionStart":168.69999998807907},{"duration":651.0999999940395,"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":169.30000001192093,"connectEnd":169.30000001192093,"connectStart":169.30000001192093,"domainLookupEnd":169.30000001192093,"domainLookupStart":169.30000001192093,"fetchStart":169.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":169.30000001192093,"responseEnd":820.4000000059605,"responseStart":820.4000000059605,"secureConnectionStart":169.30000001192093},{"duration":201.69999998807907,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":478.5,"connectEnd":478.5,"connectStart":478.5,"domainLookupEnd":478.5,"domainLookupStart":478.5,"fetchStart":478.5,"redirectEnd":0,"redirectStart":0,"requestStart":478.5,"responseEnd":680.1999999880791,"responseStart":680.1999999880791,"secureConnectionStart":478.5},{"duration":195.30000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bv2/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":749,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":749,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":944.3000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":195.09999999403954,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2bv2/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":749.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":749.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":944.5999999940395,"responseStart":0,"secureConnectionStart":0},{"duration":195.7999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":750.4000000059605,"connectEnd":750.4000000059605,"connectStart":750.4000000059605,"domainLookupEnd":750.4000000059605,"domainLookupStart":750.4000000059605,"fetchStart":750.4000000059605,"redirectEnd":0,"redirectStart":0,"requestStart":750.4000000059605,"responseEnd":946.1999999880791,"responseStart":946.1999999880791,"secureConnectionStart":750.4000000059605},{"duration":208.90000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/s/630dda803a823fdd5771c4338338e018-CDN/lu2bv2/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/js/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":751.1999999880791,"connectEnd":751.1999999880791,"connectStart":751.1999999880791,"domainLookupEnd":751.1999999880791,"domainLookupStart":751.1999999880791,"fetchStart":751.1999999880791,"redirectEnd":0,"redirectStart":0,"requestStart":751.1999999880791,"responseEnd":960.0999999940395,"responseStart":960.0999999940395,"secureConnectionStart":751.1999999880791},{"duration":207.7999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/s/53a43b6764f587426c7bb9a150184c00-CDN/lu2bv2/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":750.8000000119209,"connectEnd":750.8000000119209,"connectStart":750.8000000119209,"domainLookupEnd":750.8000000119209,"domainLookupStart":750.8000000119209,"fetchStart":750.8000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":750.8000000119209,"responseEnd":958.5999999940395,"responseStart":958.5999999940395,"secureConnectionStart":750.8000000119209}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":3,"responseStart":157,"responseEnd":168,"domLoading":160,"domInteractive":974,"domContentLoadedEventStart":974,"domContentLoadedEventEnd":1014,"domComplete":1267,"loadEventStart":1267,"loadEventEnd":1268,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":955.3000000119209},{"name":"bigPipe.sidebar-id.end","time":956.0999999940395},{"name":"bigPipe.activity-panel-pipe-id.start","time":956.1999999880791},{"name":"bigPipe.activity-panel-pipe-id.end","time":957.8000000119209},{"name":"activityTabFullyLoaded","time":1033.5}],"measures":[],"correlationId":"4109501891142a","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":92,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
thiru, do you think that the following would fix this? That is, we would only attempt to replace temporarily allocated column definitions?
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 3edb19c8e61..85d2a86e271 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1444,7 +1444,9 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
for (unsigned i= 0, j= 0; i < index->n_fields; i++)
{
const dict_col_t *col= index->fields[i].col;
- if (change_col_collate.find(col->ind) == collate_end)
+ if (col >= old_table->cols &&
+ col < old_table->cols + old_table->n_cols);
+ else if (change_col_collate.find(col->ind) == collate_end)
index->fields[i].col=
index->change_col_info->add(index->heap, *col, j++);
I am wondering if we could eliminate the change_col_collate map altogether.