Type:
Task
Priority:
Critical
Resolution:
Fixed
Moving a table out from a partitioned table is new quite cumbersome:
('archive' is here a partitioned table and 'p1' is a normal table)
CREATE TABLE tp1 LIKE archive;
ALTER TABLE tp1 REMOVE PARTITIONING;
ALTER TABLE archive EXCHANGE PARTITION p1 WITH TABLE tp1;
ALTER TABLE archive DROP PARTITION p1;
Instead one should be able to do:
ALTER TABLE archive CONVERT PARTITION p1 TO TABLE tp1;
The operation crash safety must be protected by DDL logging.
{"report":{"fcp":1167.7000000476837,"ttfb":467.40000009536743,"pageVisibility":"visible","entityId":85130,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"cb73bcfa-cca3-4dd7-a71a-536bc7273bee","navigationType":0,"readyForUser":1245.4000000953674,"redirectCount":0,"resourceLoadedEnd":1471.6000001430511,"resourceLoadedStart":473.10000014305115,"resourceTiming":[{"duration":231.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":473.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":473.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":704.6000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":231.39999985694885,"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":473.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":473.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":704.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":239.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":473.60000014305115,"connectEnd":473.60000014305115,"connectStart":473.60000014305115,"domainLookupEnd":473.60000014305115,"domainLookupStart":473.60000014305115,"fetchStart":473.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":473.60000014305115,"responseEnd":713.4000000953674,"responseStart":713.4000000953674,"secureConnectionStart":473.60000014305115},{"duration":287.90000009536743,"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":473.7999999523163,"connectEnd":473.7999999523163,"connectStart":473.7999999523163,"domainLookupEnd":473.7999999523163,"domainLookupStart":473.7999999523163,"fetchStart":473.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":473.7999999523163,"responseEnd":761.7000000476837,"responseStart":761.7000000476837,"secureConnectionStart":473.7999999523163},{"duration":291.60000014305115,"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":474,"connectEnd":474,"connectStart":474,"domainLookupEnd":474,"domainLookupStart":474,"fetchStart":474,"redirectEnd":0,"redirectStart":0,"requestStart":474,"responseEnd":765.6000001430511,"responseStart":765.6000001430511,"secureConnectionStart":474},{"duration":291.89999985694885,"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":474.10000014305115,"connectEnd":474.10000014305115,"connectStart":474.10000014305115,"domainLookupEnd":474.10000014305115,"domainLookupStart":474.10000014305115,"fetchStart":474.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":474.10000014305115,"responseEnd":766,"responseStart":766,"secureConnectionStart":474.10000014305115},{"duration":292,"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":474.2999999523163,"connectEnd":474.2999999523163,"connectStart":474.2999999523163,"domainLookupEnd":474.2999999523163,"domainLookupStart":474.2999999523163,"fetchStart":474.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":474.2999999523163,"responseEnd":766.2999999523163,"responseStart":766.2999999523163,"secureConnectionStart":474.2999999523163},{"duration":380.40000009536743,"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":474.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":474.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":854.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":292.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":474.7000000476837,"connectEnd":474.7000000476837,"connectStart":474.7000000476837,"domainLookupEnd":474.7000000476837,"domainLookupStart":474.7000000476837,"fetchStart":474.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":474.7000000476837,"responseEnd":766.7999999523163,"responseStart":766.7999999523163,"secureConnectionStart":474.7000000476837},{"duration":380.30000019073486,"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":474.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":474.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":855.1000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":292.40000009536743,"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":475,"connectEnd":475,"connectStart":475,"domainLookupEnd":475,"domainLookupStart":475,"fetchStart":475,"redirectEnd":0,"redirectStart":0,"requestStart":475,"responseEnd":767.4000000953674,"responseStart":767.4000000953674,"secureConnectionStart":475},{"duration":737.5999999046326,"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":476.40000009536743,"connectEnd":476.40000009536743,"connectStart":476.40000009536743,"domainLookupEnd":476.40000009536743,"domainLookupStart":476.40000009536743,"fetchStart":476.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":476.40000009536743,"responseEnd":1214,"responseStart":1214,"secureConnectionStart":476.40000009536743},{"duration":990.7000000476837,"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":480.90000009536743,"connectEnd":480.90000009536743,"connectStart":480.90000009536743,"domainLookupEnd":480.90000009536743,"domainLookupStart":480.90000009536743,"fetchStart":480.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":480.90000009536743,"responseEnd":1471.6000001430511,"responseStart":1471.6000001430511,"secureConnectionStart":480.90000009536743},{"duration":347.7000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":866.7000000476837,"connectEnd":866.7000000476837,"connectStart":866.7000000476837,"domainLookupEnd":866.7000000476837,"domainLookupStart":866.7000000476837,"fetchStart":866.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":866.7000000476837,"responseEnd":1214.4000000953674,"responseStart":1214.4000000953674,"secureConnectionStart":866.7000000476837},{"duration":375.7999999523163,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1160.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1160.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1536.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":309,"responseStart":468,"responseEnd":473,"domLoading":471,"domInteractive":1496,"domContentLoadedEventStart":1496,"domContentLoadedEventEnd":1537,"domComplete":1828,"loadEventStart":1828,"loadEventEnd":1829,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1473.6000001430511},{"name":"bigPipe.sidebar-id.end","time":1474.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1474.6000001430511},{"name":"bigPipe.activity-panel-pipe-id.end","time":1475.7999999523163},{"name":"activityTabFullyLoaded","time":1551}],"measures":[],"correlationId":"ce1e346d8d91d1","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":103,"dbReadsTimeInMs":17,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Should tp1 be locked under lock tables?
LOCK TABLES t1 WRITE;
ALTER TABLE t1 EXPORT PARTITION p1 AS TABLE tp1;
SELECT * from tp1;
Table 'tp1' was not locked with LOCK TABLES
I think this is a good idea to lock tp1 as well otherwise there is no guarantee of data consistency between t1 and tp1.