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":1107.2999999821186,"ttfb":276.69999998807907,"pageVisibility":"visible","entityId":59122,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"3cf7a11a-1a9b-4092-a607-304fdddb9d72","navigationType":0,"readyForUser":1197.4000000059605,"redirectCount":0,"resourceLoadedEnd":1305,"resourceLoadedStart":287.19999998807907,"resourceTiming":[{"duration":341.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":287.19999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":287.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":628.6999999880791,"responseStart":0,"secureConnectionStart":0},{"duration":341.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":287.40000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":287.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":629.0999999940395,"responseStart":0,"secureConnectionStart":0},{"duration":350.59999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":287.5,"connectEnd":287.5,"connectStart":287.5,"domainLookupEnd":287.5,"domainLookupStart":287.5,"fetchStart":287.5,"redirectEnd":0,"redirectStart":0,"requestStart":287.5,"responseEnd":638.0999999940395,"responseStart":638.0999999940395,"secureConnectionStart":287.5},{"duration":389.30000001192093,"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":287.69999998807907,"connectEnd":287.69999998807907,"connectStart":287.69999998807907,"domainLookupEnd":287.69999998807907,"domainLookupStart":287.69999998807907,"fetchStart":287.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":287.69999998807907,"responseEnd":677,"responseStart":677,"secureConnectionStart":287.69999998807907},{"duration":393,"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":287.90000000596046,"connectEnd":287.90000000596046,"connectStart":287.90000000596046,"domainLookupEnd":287.90000000596046,"domainLookupStart":287.90000000596046,"fetchStart":287.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":287.90000000596046,"responseEnd":680.9000000059605,"responseStart":680.9000000059605,"secureConnectionStart":287.90000000596046},{"duration":393.09999999403954,"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":288.19999998807907,"connectEnd":288.19999998807907,"connectStart":288.19999998807907,"domainLookupEnd":288.19999998807907,"domainLookupStart":288.19999998807907,"fetchStart":288.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":288.19999998807907,"responseEnd":681.2999999821186,"responseStart":681.2999999821186,"secureConnectionStart":288.19999998807907},{"duration":393.2999999821186,"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":288.40000000596046,"connectEnd":288.40000000596046,"connectStart":288.40000000596046,"domainLookupEnd":288.40000000596046,"domainLookupStart":288.40000000596046,"fetchStart":288.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":288.40000000596046,"responseEnd":681.6999999880791,"responseStart":681.6999999880791,"secureConnectionStart":288.40000000596046},{"duration":493.7999999821186,"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":288.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":288.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":782.2999999821186,"responseStart":0,"secureConnectionStart":0},{"duration":393.40000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":288.69999998807907,"connectEnd":288.69999998807907,"connectStart":288.69999998807907,"domainLookupEnd":288.69999998807907,"domainLookupStart":288.69999998807907,"fetchStart":288.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":288.69999998807907,"responseEnd":682.0999999940395,"responseStart":682.0999999940395,"secureConnectionStart":288.69999998807907},{"duration":493.59999999403954,"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":288.90000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":288.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":782.5,"responseStart":0,"secureConnectionStart":0},{"duration":393.59999999403954,"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":289,"connectEnd":289,"connectStart":289,"domainLookupEnd":289,"domainLookupStart":289,"fetchStart":289,"redirectEnd":0,"redirectStart":0,"requestStart":289,"responseEnd":682.5999999940395,"responseStart":682.5999999940395,"secureConnectionStart":289},{"duration":909.5999999940395,"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":300.69999998807907,"connectEnd":300.69999998807907,"connectStart":300.69999998807907,"domainLookupEnd":300.69999998807907,"domainLookupStart":300.69999998807907,"fetchStart":300.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":300.69999998807907,"responseEnd":1210.2999999821186,"responseStart":1210.2999999821186,"secureConnectionStart":300.69999998807907},{"duration":1004.3000000119209,"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":300.69999998807907,"connectEnd":300.69999998807907,"connectStart":300.69999998807907,"domainLookupEnd":300.69999998807907,"domainLookupStart":300.69999998807907,"fetchStart":300.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":300.69999998807907,"responseEnd":1305,"responseStart":1305,"secureConnectionStart":300.69999998807907},{"duration":418.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":794.4000000059605,"connectEnd":794.4000000059605,"connectStart":794.4000000059605,"domainLookupEnd":794.4000000059605,"domainLookupStart":794.4000000059605,"fetchStart":794.4000000059605,"redirectEnd":0,"redirectStart":0,"requestStart":794.4000000059605,"responseEnd":1212.9000000059605,"responseStart":1212.9000000059605,"secureConnectionStart":794.4000000059605},{"duration":275.59999999403954,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1101,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1101,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1376.5999999940395,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":96,"responseStart":276,"responseEnd":299,"domLoading":285,"domInteractive":1329,"domContentLoadedEventStart":1329,"domContentLoadedEventEnd":1372,"domComplete":2271,"loadEventStart":2271,"loadEventEnd":2272,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1307.2999999821186},{"name":"bigPipe.sidebar-id.end","time":1308.199999988079},{"name":"bigPipe.activity-panel-pipe-id.start","time":1308.4000000059605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1311},{"name":"activityTabFullyLoaded","time":1400.2999999821186}],"measures":[],"correlationId":"7824734a0cd4c8","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":112,"dbReadsTimeInMs":21,"dbConnsTimeInMs":31,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}