Hi, I have a question about partition reorganizing while I'm trying to test.
I use LIST COLUMNS type and DEFAULT partition.
I want to split (reorganize) specific value of DEFAULT partition into other new partitions.
Here is the script.
---------------------------------------------------------------------------------------------------
CREATE TABLE PAR_TEST
(
COL VARCHAR(6)
);
ALTER TABLE PAR_TEST PARTITION BY LIST COLUMNS (COL) (
PARTITION P_00000 VALUES IN ('00000'),
PARTITION P_00001 VALUES IN ('00001'),
PARTITION P_00002 VALUES IN ('00002'),
PARTITION P_00003 VALUES IN ('00003'),
PARTITION P_00004 VALUES IN ('00004'),
PARTITION P_DEFAULT DEFAULT);
INSERT INTO PAR_TEST
VALUES ('00000'),('00001'),('00002'),('00003'),('00004'),('11111'),('22222'),('22222'), ('TEST'), ('TEST1');
-------------------------------------------------------------------------------------------------
<TEST1>
ALTER TABLE PAR_TEST
REORGANIZE PARTITION P_DEFAULT INTO
(PARTITION P_DEFAULT DEFAULT, PARTITION P_11111 VALUES IN ('11111'), PARTITION P_22222 VALUES IN ('22222')
);
<TEST2>
ALTER TABLE PAR_TEST
REORGANIZE PARTITION P_DEFAULT INTO
(PARTITION P_11111 VALUES IN ('11111'), PARTITION P_22222 VALUES IN ('22222'),PARTITION P_DEFAULT DEFAULT
);
--------------------------------------------------------------------------------------------------
The only difference between TEST1 AND TEST2 is just the order of 'P_11111' and 'P_DEFAULT'
in REORGANIZE PARTITION clause.
When I select a certain partition, TEST1 shows the result what I expected.
But, If I select DEFAULT partition, it shows nothing.
(SELECT * FROM PAR_TEST PARTITION(P_DEFAULT); -> no result)
And the values which should be in DEFAULT partition are in 'P_11111' partition.
(SELECT * FROM PAR_TEST PARTITION(P_11111); -> 11111, TEST, TEST1 (3 rows))
I wonder if it is intended or bug.
Thank you.
{"report":{"fcp":716.3000000119209,"ttfb":193.5,"pageVisibility":"visible","entityId":80410,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"77920be2-b360-4be4-b931-81b52ff8e367","navigationType":0,"readyForUser":780.3000000119209,"redirectCount":0,"resourceLoadedEnd":801.5999999940395,"resourceLoadedStart":199.09999999403954,"resourceTiming":[{"duration":8,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":199.09999999403954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":199.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":207.09999999403954,"responseStart":0,"secureConnectionStart":0},{"duration":8.099999994039536,"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":199.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":199.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":207.40000000596046,"responseStart":0,"secureConnectionStart":0},{"duration":69.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":199.59999999403954,"connectEnd":199.59999999403954,"connectStart":199.59999999403954,"domainLookupEnd":199.59999999403954,"domainLookupStart":199.59999999403954,"fetchStart":199.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":199.59999999403954,"responseEnd":268.7000000178814,"responseStart":268.7000000178814,"secureConnectionStart":199.59999999403954},{"duration":188.89999997615814,"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":199.7000000178814,"connectEnd":199.7000000178814,"connectStart":199.7000000178814,"domainLookupEnd":199.7000000178814,"domainLookupStart":199.7000000178814,"fetchStart":199.7000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":199.7000000178814,"responseEnd":388.59999999403954,"responseStart":388.59999999403954,"secureConnectionStart":199.7000000178814},{"duration":192.30000001192093,"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":199.90000000596046,"connectEnd":199.90000000596046,"connectStart":199.90000000596046,"domainLookupEnd":199.90000000596046,"domainLookupStart":199.90000000596046,"fetchStart":199.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":199.90000000596046,"responseEnd":392.2000000178814,"responseStart":392.2000000178814,"secureConnectionStart":199.90000000596046},{"duration":192.39999997615814,"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":200.2000000178814,"connectEnd":200.2000000178814,"connectStart":200.2000000178814,"domainLookupEnd":200.2000000178814,"domainLookupStart":200.2000000178814,"fetchStart":200.2000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":200.2000000178814,"responseEnd":392.59999999403954,"responseStart":392.59999999403954,"secureConnectionStart":200.2000000178814},{"duration":192.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":200.30000001192093,"connectEnd":200.30000001192093,"connectStart":200.30000001192093,"domainLookupEnd":200.30000001192093,"domainLookupStart":200.30000001192093,"fetchStart":200.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":200.30000001192093,"responseEnd":392.90000000596046,"responseStart":392.90000000596046,"secureConnectionStart":200.30000001192093},{"duration":208.30000001192093,"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":200.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":200.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":408.80000001192093,"responseStart":0,"secureConnectionStart":0},{"duration":192.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":200.59999999403954,"connectEnd":200.59999999403954,"connectStart":200.59999999403954,"domainLookupEnd":200.59999999403954,"domainLookupStart":200.59999999403954,"fetchStart":200.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":200.59999999403954,"responseEnd":393.2000000178814,"responseStart":393.2000000178814,"secureConnectionStart":200.59999999403954},{"duration":208.09999999403954,"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":200.90000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":200.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":409,"responseStart":0,"secureConnectionStart":0},{"duration":192.80000001192093,"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":201,"connectEnd":201,"connectStart":201,"domainLookupEnd":201,"domainLookupStart":201,"fetchStart":201,"redirectEnd":0,"redirectStart":0,"requestStart":201,"responseEnd":393.80000001192093,"responseStart":393.80000001192093,"secureConnectionStart":201},{"duration":545,"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":201.80000001192093,"connectEnd":201.80000001192093,"connectStart":201.80000001192093,"domainLookupEnd":201.80000001192093,"domainLookupStart":201.80000001192093,"fetchStart":201.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":201.80000001192093,"responseEnd":746.8000000119209,"responseStart":746.8000000119209,"secureConnectionStart":201.80000001192093},{"duration":545.1999999880791,"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":201.90000000596046,"connectEnd":201.90000000596046,"connectStart":201.90000000596046,"domainLookupEnd":201.90000000596046,"domainLookupStart":201.90000000596046,"fetchStart":201.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":201.90000000596046,"responseEnd":747.0999999940395,"responseStart":747.0999999940395,"secureConnectionStart":201.90000000596046},{"duration":94,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":420.09999999403954,"connectEnd":420.09999999403954,"connectStart":420.09999999403954,"domainLookupEnd":420.09999999403954,"domainLookupStart":420.09999999403954,"fetchStart":420.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":420.09999999403954,"responseEnd":514.0999999940395,"responseStart":514.0999999940395,"secureConnectionStart":420.09999999403954},{"duration":128.19999998807907,"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":673.4000000059605,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":673.4000000059605,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":801.5999999940395,"responseStart":0,"secureConnectionStart":0},{"duration":73.59999999403954,"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":674.2000000178814,"connectEnd":674.2000000178814,"connectStart":674.2000000178814,"domainLookupEnd":674.2000000178814,"domainLookupStart":674.2000000178814,"fetchStart":674.2000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":674.2000000178814,"responseEnd":747.8000000119209,"responseStart":747.8000000119209,"secureConnectionStart":674.2000000178814},{"duration":75.40000000596046,"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":674.5999999940395,"connectEnd":674.5999999940395,"connectStart":674.5999999940395,"domainLookupEnd":674.5999999940395,"domainLookupStart":674.5999999940395,"fetchStart":674.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":674.5999999940395,"responseEnd":750,"responseStart":750,"secureConnectionStart":674.5999999940395},{"duration":133.59999999403954,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":710.2000000178814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":710.2000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":843.8000000119209,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":36,"responseStart":194,"responseEnd":196,"domLoading":197,"domInteractive":898,"domContentLoadedEventStart":898,"domContentLoadedEventEnd":939,"domComplete":1109,"loadEventStart":1109,"loadEventEnd":1110,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":853.0999999940395},{"name":"bigPipe.sidebar-id.end","time":853.8000000119209},{"name":"bigPipe.activity-panel-pipe-id.start","time":854},{"name":"bigPipe.activity-panel-pipe-id.end","time":857.5},{"name":"activityTabFullyLoaded","time":950.5999999940395}],"measures":[],"correlationId":"78a588d69872eb","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":100,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thanks a lot! Looks like a bug, I repeated on 10.2-10.4:
--source include/have_partition.inc
MariaDB [test]> select * from t1 partition(p_default);
Empty set (0.00 sec)
MariaDB [test]> select * from t1 partition(p_11111);
+-------+
| a |
+-------+
| 11111 |
| test |
| test1 |
+-------+
3 rows in set (0.00 sec)
MariaDB [test]> show create table t1;
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`a` varchar(6) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY LIST COLUMNS(`a`)
(PARTITION `p_11111` VALUES IN ('11111') ENGINE = InnoDB,
PARTITION `p_22222` VALUES IN ('22222') ENGINE = InnoDB,
PARTITION `p_default` DEFAULT ENGINE = InnoDB) |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
MariaDB [test]> select * from t1 where a not in ('11111','22222');
Empty set (0.00 sec)
MariaDB [test]> select * from t1;
+-------+
| a |
+-------+
| 11111 |
| test |
| test1 |
| 22222 |
| 22222 |
+-------+
5 rows in set (0.01 sec)
MariaDB [test]> explain partitions select * from t1 where a not in ('11111','22222');
+------+-------------+-------+------------+------+---------------+------+---------+------+------+-------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------+------------+------+---------------+------+---------+------+------+-------------+
| 1 | SIMPLE | t1 | p_default | ALL | NULL | NULL | NULL | NULL | 2 | Using where |
+------+-------------+-------+------------+------+---------------+------+---------+------+------+-------------+
1 row in set (0.00 sec)