[MDEV-11412] Ensure that table is truly dropped when using DROP TABLE Created: 2016-11-29 Updated: 2023-03-02 Resolved: 2020-06-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Fix Version/s: | 10.5.4 |
| Type: | Task | Priority: | Critical |
| Reporter: | Sergey Vojtovich | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Epic Link: | AliSQL patches | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
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.
https://github.com/alibaba/AliSQL/commit/fc7e697b8b34a7751da8c8dca54ba152601d9ee5 In the end we decided to support the idea of FORCE but without the FORCE keyword:
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:
|
| Comments |
| Comment by Elena Stepanova [ 2020-06-10 ] | ||||||||||||||||||||||||||
|
A note just for the record (it has already been discussed and confirmed to be expected). 1) If .par file is missing, orphan per-partition data files don't get removed upon DROP TABLE:
2) If .TRG file is missing, orphan .TRN files don't get removed upon DROP TABLE
| ||||||||||||||||||||||||||
| Comment by Daniel Lenski [ 2021-11-05 ] | ||||||||||||||||||||||||||
|
Has this fix been verified to “play nicely” with the new S3 Storage Engine added in 10.5.4? When an existing table is converted to S3 Storage Engine (with ALTER TABLE test ENGINE=S3), only the .frm file is "left behind" in local storage, but the other files (e.g. .ibd) are removed
| ||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-11-07 ] | ||||||||||||||||||||||||||
|
Yes, there are test cases (for example here) that create and drop S3 tables. They're run in CI, so we'd notice if DROP wouldn't work. | ||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2022-12-13 ] | ||||||||||||||||||||||||||
|
Regarding S3. | ||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2022-12-13 ] | ||||||||||||||||||||||||||
|
There are patches for backporting this to 10.2, but would advice against doing that as there has been a lot of changes in the code between 10.5 and 10.2 and backporting these to 10.2 can cause other unforeseen larger problems. |