Type:
Task
Priority:
Critical
Resolution:
Fixed
This task is based on a patch/idea from Ali-SQL: "[Feature] Issue#34 Support force drop table" and a patch from Tencent related to the same problem.
--------
Usually the meta data is not consistent between server layer and InnoDB layer.
So we supply a new syntax to clear the meta data.
Usage:
------
1. DROP TABLE FORCE t1;
2. ALTER TABLE t1 DROP PARTITION force p2;
https://github.com/alibaba/AliSQL/commit/fc7e697b8b34a7751da8c8dca54ba152601d9ee5
In the end we decided to support the idea of FORCE but without the FORCE keyword:
If a .frm table doesn't exists, try dropping the table from all storage engines.
If the .frm table exists but the table does not exist in the engine try dropping the table from all storage engines.
Update storage engines using many table files (.CSV, MyISAM, Aria) to succeed with the drop even if some of the files are missing.
Add HTON_AUTOMATIC_DELETE_TABLE to handlerton's where delete_table() is not needed and always succeed. This is used by ha_delete_table_force() to know which handlers to ignore when trying to drop a table without a .frm file.
The disadvantage of this solution is that a DROP TABLE on a non existing table will be a bit slower as we have to ask all active storage engines if they know anything about the table.
Things left to do in another MDEV:
Handle dropping of partitioned tables without .par file or .frm
Verify that one can drop partitions with a DROP TABLE #mysql50#...
{"report":{"fcp":842.2000000029802,"ttfb":249.80000001192093,"pageVisibility":"visible","entityId":59122,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"697ab4e0-a176-4490-b6b8-065df320ebc5","navigationType":0,"readyForUser":933.7000000029802,"redirectCount":0,"resourceLoadedEnd":985.7000000029802,"resourceLoadedStart":255.30000001192093,"resourceTiming":[{"duration":125.79999999701977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":255.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":255.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":381.1000000089407,"responseStart":0,"secureConnectionStart":0},{"duration":125.70000000298023,"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":255.6000000089407,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":255.6000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":381.30000001192093,"responseStart":0,"secureConnectionStart":0},{"duration":134.29999999701977,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":255.70000000298023,"connectEnd":255.70000000298023,"connectStart":255.70000000298023,"domainLookupEnd":255.70000000298023,"domainLookupStart":255.70000000298023,"fetchStart":255.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":255.70000000298023,"responseEnd":390,"responseStart":390,"secureConnectionStart":255.70000000298023},{"duration":203.70000000298023,"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":255.90000000596046,"connectEnd":255.90000000596046,"connectStart":255.90000000596046,"domainLookupEnd":255.90000000596046,"domainLookupStart":255.90000000596046,"fetchStart":255.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":255.90000000596046,"responseEnd":459.6000000089407,"responseStart":459.6000000089407,"secureConnectionStart":255.90000000596046},{"duration":207.09999999403954,"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":256.1000000089407,"connectEnd":256.1000000089407,"connectStart":256.1000000089407,"domainLookupEnd":256.1000000089407,"domainLookupStart":256.1000000089407,"fetchStart":256.1000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":256.1000000089407,"responseEnd":463.20000000298023,"responseStart":463.20000000298023,"secureConnectionStart":256.1000000089407},{"duration":207.3999999910593,"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":256.30000001192093,"connectEnd":256.30000001192093,"connectStart":256.30000001192093,"domainLookupEnd":256.30000001192093,"domainLookupStart":256.30000001192093,"fetchStart":256.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":256.30000001192093,"responseEnd":463.70000000298023,"responseStart":463.70000000298023,"secureConnectionStart":256.30000001192093},{"duration":207.6000000089407,"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":256.5,"connectEnd":256.5,"connectStart":256.5,"domainLookupEnd":256.5,"domainLookupStart":256.5,"fetchStart":256.5,"redirectEnd":0,"redirectStart":0,"requestStart":256.5,"responseEnd":464.1000000089407,"responseStart":464.1000000089407,"secureConnectionStart":256.5},{"duration":273.5,"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":256.6000000089407,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256.6000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":530.1000000089407,"responseStart":0,"secureConnectionStart":0},{"duration":207.59999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":256.80000001192093,"connectEnd":256.80000001192093,"connectStart":256.80000001192093,"domainLookupEnd":256.80000001192093,"domainLookupStart":256.80000001192093,"fetchStart":256.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":256.80000001192093,"responseEnd":464.40000000596046,"responseStart":464.40000000596046,"secureConnectionStart":256.80000001192093},{"duration":273.40000000596046,"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":256.90000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":530.3000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":207.8999999910593,"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":257.1000000089407,"connectEnd":257.1000000089407,"connectStart":257.1000000089407,"domainLookupEnd":257.1000000089407,"domainLookupStart":257.1000000089407,"fetchStart":257.1000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":257.1000000089407,"responseEnd":465,"responseStart":465,"secureConnectionStart":257.1000000089407},{"duration":393.20000000298023,"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":258.90000000596046,"connectEnd":258.90000000596046,"connectStart":258.90000000596046,"domainLookupEnd":258.90000000596046,"domainLookupStart":258.90000000596046,"fetchStart":258.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":258.90000000596046,"responseEnd":652.1000000089407,"responseStart":652.1000000089407,"secureConnectionStart":258.90000000596046},{"duration":726.7999999970198,"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":258.90000000596046,"connectEnd":258.90000000596046,"connectStart":258.90000000596046,"domainLookupEnd":258.90000000596046,"domainLookupStart":258.90000000596046,"fetchStart":258.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":258.90000000596046,"responseEnd":985.7000000029802,"responseStart":985.7000000029802,"secureConnectionStart":258.90000000596046},{"duration":111,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":541.5,"connectEnd":541.5,"connectStart":541.5,"domainLookupEnd":541.5,"domainLookupStart":541.5,"fetchStart":541.5,"redirectEnd":0,"redirectStart":0,"requestStart":541.5,"responseEnd":652.5,"responseStart":652.5,"secureConnectionStart":541.5},{"duration":278.5,"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":798.1000000089407,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":798.1000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1076.6000000089407,"responseStart":0,"secureConnectionStart":0},{"duration":240.20000000298023,"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":799,"connectEnd":799,"connectStart":799,"domainLookupEnd":799,"domainLookupStart":799,"fetchStart":799,"redirectEnd":0,"redirectStart":0,"requestStart":799,"responseEnd":1039.2000000029802,"responseStart":1039.2000000029802,"secureConnectionStart":799},{"duration":244.8999999910593,"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":799.3000000119209,"connectEnd":799.3000000119209,"connectStart":799.3000000119209,"domainLookupEnd":799.3000000119209,"domainLookupStart":799.3000000119209,"fetchStart":799.3000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":799.3000000119209,"responseEnd":1044.2000000029802,"responseStart":1044.2000000029802,"secureConnectionStart":799.3000000119209},{"duration":254.70000000298023,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":836.6000000089407,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":836.6000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1091.300000011921,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":34,"responseStart":250,"responseEnd":253,"domLoading":253,"domInteractive":1030,"domContentLoadedEventStart":1030,"domContentLoadedEventEnd":1076,"domComplete":2183,"loadEventStart":2183,"loadEventEnd":2185,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1016.2000000029802},{"name":"bigPipe.sidebar-id.end","time":1017.1000000089407},{"name":"bigPipe.activity-panel-pipe-id.start","time":1017.2000000029802},{"name":"bigPipe.activity-panel-pipe-id.end","time":1019.8000000119209},{"name":"activityTabFullyLoaded","time":1095.7000000029802}],"measures":[],"correlationId":"31c3ee292b3edd","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":117,"dbReadsTimeInMs":23,"dbConnsTimeInMs":32,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}