Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.8(EOL) , 10.11 , 11.0(EOL) , 11.1(EOL) , 11.2(EOL) , 11.3(EOL) , 11.4
--source include/have_innodb.inc
--source include/have_partition.inc
--let $restart_parameters= --innodb-sys-tablespaces
--source include/restart_mysqld.inc
create table t (a int ) engine=InnoDB
partition by list (a) (
partition p0 values in (1,2) page_compressed=yes,
partition p1 values in (7,8)
);
insert into t values (1),(8);
create table t1 (a int ) engine=InnoDB;
insert into t1 values (1),(2);
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test/t%' ;
alter table t exchange partition p0 with table t1;
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
alter table t force ;
alter table t1 force ;
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
alter table t force , algorithm=COPY;
alter table t1 force , algorithm=COPY;
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
show create table t1;
show create table t;
# Cleanup
drop table if exists t, t1;
In the test case above, we exchange partition p0 of table t with table t1 .
Originally the partition p0 has attribute page_compressed=yes . Table t1 doesn't.
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test/t%' ;
name flag
test/t#P#p0 1610612789
test/t#P#p1 21
test/t1 21
EXCHANGE does not recognize the difference and allows the operation.
Right after the exchange the flags on tablespaces become
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
name flag
test/t1 1610612789
test/t#P#p1 21
test/t#P#p0 21
while the table definitions remain as they were
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int (11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE =latin1_swedish_ci
show create table t;
Table Create Table
t CREATE TABLE `t` (
`a` int (11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE =latin1_swedish_ci
PARTITION BY LIST (`a`)
(PARTITION `p0` VALUES IN (1,2) ENGINE = InnoDB page_compressed = yes,
PARTITION `p1` VALUES IN (7,8) ENGINE = InnoDB)
that is, t1 tablespace has the compressed flag even although it shouldn't, while p0 doesn't have the flag even though it should – which is understandable, as they were merely swapped, but unfortunate.
Further, after the inplace operation ALTER TABLE .. FORCE , the flags become
name flag
test/t#P#p0 21
test/t#P#p1 21
test/t1 21
That is, none of tablespaces has the flag anymore.
And only after the copying ALTER, they become synchronized with the table definition
name flag
test/t#P#p0 1610612789
test/t#P#p1 21
test/t1 21
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int (11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE =latin1_swedish_ci
show create table t;
Table Create Table
t CREATE TABLE `t` (
`a` int (11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE =latin1_swedish_ci
PARTITION BY LIST (`a`)
(PARTITION `p0` VALUES IN (1,2) ENGINE = InnoDB page_compressed = yes,
PARTITION `p1` VALUES IN (7,8) ENGINE = InnoDB)
Maybe the core problem here is that EXCHANGE only checks that table definitions are identical, but doesn't take into account the possibility of per-partition attributes.
A somewhat similar situation occurs when a table is converted into a partition. A table without a flag is allowed to be converted into a partition with the flag, but the attribute isn't applied until the partition is rebuilt.
--source include/have_innodb.inc
--source include/have_partition.inc
--let $restart_parameters= --innodb-sys-tablespaces
--source include/restart_mysqld.inc
create table t (a int ) engine=InnoDB
partition by list (a) (
partition p0 values in (1,2)
);
insert into t values (1);
create table t1 (a int ) engine=InnoDB;
insert into t1 values (3),(4);
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test/t%' ;
alter table t convert table t1 to partition pn values in (3,4) page_compressed=yes;
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
alter table t force ;
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
alter table t rebuild partition pn;
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
show create table t;
# Cleanup
drop table if exists t, t1;
11.4 875377ad824473774c833b1aff4346ba3133f092
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
name flag
test/t#P#p0 21
test/t#P#pn 21
alter table t force ;
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
name flag
test/t#P#p0 21
test/t#P#pn 21
alter table t rebuild partition pn;
select name , flag from information_schema.innodb_sys_tablespaces where name like 'test%' ;
name flag
test/t#P#p0 21
test/t#P#pn 1610612789
show create table t;
Table Create Table
t CREATE TABLE `t` (
`a` int (11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE =latin1_swedish_ci
PARTITION BY LIST (`a`)
(PARTITION `p0` VALUES IN (1,2) ENGINE = InnoDB,
PARTITION `pn` VALUES IN (3,4) ENGINE = InnoDB page_compressed = yes)
is caused by
MDEV-5271
Support engine-defined attributes per partition
Closed
There are no comments yet on this issue.
{"report":{"fcp":1049.5,"ttfb":343.5,"pageVisibility":"visible","entityId":127119,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"bef8d575-2e25-4d77-9780-cd447010b287","navigationType":0,"readyForUser":1235,"redirectCount":0,"resourceLoadedEnd":1253.0999999046326,"resourceLoadedStart":354.30000019073486,"resourceTiming":[{"duration":187,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":354.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":541.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":187.10000038146973,"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":354.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":541.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":195.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":354.80000019073486,"connectEnd":354.80000019073486,"connectStart":354.80000019073486,"domainLookupEnd":354.80000019073486,"domainLookupStart":354.80000019073486,"fetchStart":354.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":354.80000019073486,"responseEnd":550.5,"responseStart":550.5,"secureConnectionStart":354.80000019073486},{"duration":271.59999990463257,"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":355,"connectEnd":355,"connectStart":355,"domainLookupEnd":355,"domainLookupStart":355,"fetchStart":355,"redirectEnd":0,"redirectStart":0,"requestStart":355,"responseEnd":626.5999999046326,"responseStart":626.5999999046326,"secureConnectionStart":355},{"duration":275.2999997138977,"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":355.2000002861023,"connectEnd":355.2000002861023,"connectStart":355.2000002861023,"domainLookupEnd":355.2000002861023,"domainLookupStart":355.2000002861023,"fetchStart":355.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":355.2000002861023,"responseEnd":630.5,"responseStart":630.5,"secureConnectionStart":355.2000002861023},{"duration":275.40000009536743,"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":355.40000009536743,"connectEnd":355.40000009536743,"connectStart":355.40000009536743,"domainLookupEnd":355.40000009536743,"domainLookupStart":355.40000009536743,"fetchStart":355.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":355.40000009536743,"responseEnd":630.8000001907349,"responseStart":630.8000001907349,"secureConnectionStart":355.40000009536743},{"duration":275.80000019073486,"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":355.59999990463257,"connectEnd":355.59999990463257,"connectStart":355.59999990463257,"domainLookupEnd":355.59999990463257,"domainLookupStart":355.59999990463257,"fetchStart":355.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":355.59999990463257,"responseEnd":631.4000000953674,"responseStart":631.4000000953674,"secureConnectionStart":355.59999990463257},{"duration":339.19999980926514,"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":355.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":694.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":276.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":355.90000009536743,"connectEnd":355.90000009536743,"connectStart":355.90000009536743,"domainLookupEnd":355.90000009536743,"domainLookupStart":355.90000009536743,"fetchStart":355.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":355.90000009536743,"responseEnd":632.4000000953674,"responseStart":632.4000000953674,"secureConnectionStart":355.90000009536743},{"duration":339,"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":356,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":356,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":695,"responseStart":0,"secureConnectionStart":0},{"duration":277.2999997138977,"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":356.2000002861023,"connectEnd":356.2000002861023,"connectStart":356.2000002861023,"domainLookupEnd":356.2000002861023,"domainLookupStart":356.2000002861023,"fetchStart":356.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":356.2000002861023,"responseEnd":633.5,"responseStart":633.5,"secureConnectionStart":356.2000002861023},{"duration":336.19999980926514,"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":362.7000002861023,"connectEnd":362.7000002861023,"connectStart":362.7000002861023,"domainLookupEnd":362.7000002861023,"domainLookupStart":362.7000002861023,"fetchStart":362.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":362.7000002861023,"responseEnd":698.9000000953674,"responseStart":698.9000000953674,"secureConnectionStart":362.7000002861023},{"duration":339.90000009536743,"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":363.30000019073486,"connectEnd":363.30000019073486,"connectStart":363.30000019073486,"domainLookupEnd":363.30000019073486,"domainLookupStart":363.30000019073486,"fetchStart":363.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":363.30000019073486,"responseEnd":703.2000002861023,"responseStart":703.0999999046326,"secureConnectionStart":363.30000019073486},{"duration":20.100000381469727,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":721.5999999046326,"connectEnd":721.5999999046326,"connectStart":721.5999999046326,"domainLookupEnd":721.5999999046326,"domainLookupStart":721.5999999046326,"fetchStart":721.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":721.5999999046326,"responseEnd":741.7000002861023,"responseStart":741.7000002861023,"secureConnectionStart":721.5999999046326},{"duration":220.7999997138977,"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":745.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":745.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":966.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":220.5,"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":746.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":746.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":966.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":498.69999980926514,"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":747.2000002861023,"connectEnd":747.2000002861023,"connectStart":747.2000002861023,"domainLookupEnd":747.2000002861023,"domainLookupStart":747.2000002861023,"fetchStart":747.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":747.2000002861023,"responseEnd":1245.9000000953674,"responseStart":1245.9000000953674,"secureConnectionStart":747.2000002861023},{"duration":503.59999990463257,"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":747.7000002861023,"connectEnd":747.7000002861023,"connectStart":747.7000002861023,"domainLookupEnd":747.7000002861023,"domainLookupStart":747.7000002861023,"fetchStart":747.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":747.7000002861023,"responseEnd":1251.3000001907349,"responseStart":1251.3000001907349,"secureConnectionStart":747.7000002861023},{"duration":505.09999990463257,"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":748,"connectEnd":748,"connectStart":748,"domainLookupEnd":748,"domainLookupStart":748,"fetchStart":748,"redirectEnd":0,"redirectStart":0,"requestStart":748,"responseEnd":1253.0999999046326,"responseStart":1253.0999999046326,"secureConnectionStart":748},{"duration":299.40000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1050.3000001907349,"connectEnd":1050.3000001907349,"connectStart":1050.3000001907349,"domainLookupEnd":1050.3000001907349,"domainLookupStart":1050.3000001907349,"fetchStart":1050.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1050.3000001907349,"responseEnd":1349.7000002861023,"responseStart":1349.7000002861023,"secureConnectionStart":1050.3000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":128,"responseStart":344,"responseEnd":363,"domLoading":352,"domInteractive":1276,"domContentLoadedEventStart":1276,"domContentLoadedEventEnd":1338,"domComplete":1834,"loadEventStart":1834,"loadEventEnd":1834,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1255.8000001907349},{"name":"bigPipe.sidebar-id.end","time":1256.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1256.7000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":1257.2000002861023},{"name":"activityTabFullyLoaded","time":1362.3000001907349}],"measures":[],"correlationId":"d6524a25204d5c","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":110,"dbReadsTimeInMs":9,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}