Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
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.
--------
|
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#...
Attachments
Issue Links
- blocks
-
MDEV-23570 deprecate keep_files_on_create
-
- Closed
-
- causes
-
MDEV-23549 CREATE fails after DROP without FRM
-
- Closed
-
-
MDEV-30170 no error for DROP TABLE and no warning for DROP TABLE IF EXISTS with absent table when Spider plugin is included
-
- Closed
-
-
MDEV-34205 ASAN stack-buffer-overflow in strxnmov | frm_file_exists
-
- Closed
-
- relates to
-
MCOL-4164 Multi-table DROP
-
- Closed
-
-
MDEV-25373 DROP TABLE doesn't raise error while dropping non-existing table in MariaDB 10.5.9 when OQGraph SE is loaded to the server
-
- Closed
-
-
MDEV-26966 The parameter innodb_force_load_corrupted makes no sense
-
- Closed
-
-
MDEV-15185 PARTITION files removed, but not from INFORMATION_SCHEMA.INNODB_SYS_TABLES
-
- Closed
-
-
MDEV-16417 Store Foreign Key metadata outside of InnoDB
-
- In Review
-
-
MDEV-23000 Ensure we get a warning from THD::drop_temporary_table() in case of disk errors
-
- Closed
-
-
MDEV-23185 CREATE OR REPLACE TABLE is less robust than DROP TABLE + CREATE TABLE
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
Epic Link | MDEV-11372 [ 59082 ] |
Link |
This issue relates to |
Fix Version/s | 10.3 [ 22126 ] |
Assignee | Michael Widenius [ monty ] |
Fix Version/s | 10.5.4 [ 24264 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Description |
{noformat}
Summary: -------- 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; {noformat} https://github.com/alibaba/AliSQL/commit/fc7e697b8b34a7751da8c8dca54ba152601d9ee5 |
{noformat}
Summary: -------- 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; {noformat} 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 doesn't, try dropping the table from all storage engines. |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.5.4 [ 24264 ] |
Assignee | Michael Widenius [ monty ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Description |
{noformat}
Summary: -------- 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; {noformat} 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 doesn't, try dropping the table from all storage engines. |
This task is based on patches from Ali-SQL
{noformat} -------- 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; {noformat} 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 doesn't, try dropping the table from all storage engines. |
Description |
This task is based on patches from Ali-SQL
{noformat} -------- 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; {noformat} 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 doesn't, try dropping the table from all storage engines. |
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.
{noformat} -------- 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; {noformat} 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 doesn't, try dropping the table from all storage engines. |
Summary | AliSQL: [Feature] Issue#34 Support force drop table | Ensure that table is truly dropped when using DROP TABLE |
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.
{noformat} -------- 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; {noformat} 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 doesn't, try dropping the table from all storage engines. |
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.
{noformat} -------- 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; {noformat} 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 (.CVS, 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. |
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.
{noformat} -------- 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; {noformat} 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 (.CVS, 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. |
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.
{noformat} -------- 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; {noformat} 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 (.CVS, 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#... |
Component/s | Server [ 13907 ] | |
Fix Version/s | 10.5.4 [ 24264 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Review [ 10002 ] | Closed [ 6 ] |
Assignee | Sergei Golubchik [ serg ] | Michael Widenius [ monty ] |
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.
{noformat} -------- 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; {noformat} 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 (.CVS, 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#... |
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.
{noformat} -------- 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; {noformat} 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#... |
Link | This issue relates to MDEV-23185 [ MDEV-23185 ] |
Link | This issue relates to MDEV-16417 [ MDEV-16417 ] |
Link |
This issue causes |
Link |
This issue blocks |
Link |
This issue relates to |
Link |
This issue relates to |
Workflow | MariaDB v3 [ 78522 ] | MariaDB v4 [ 133045 ] |
Link |
This issue causes |
Link |
This issue relates to |
Remote Link | This issue links to "Page (MariaDB Confluence)" [ 36718 ] |
Remote Link | This issue links to "Page (MariaDB Confluence)" [ 36718 ] |
Link |
This issue causes |
Zendesk Related Tickets | 201658 | |
Zendesk active tickets | 201658 |
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:
--source include/have_partition.inc
--let $datadir= `select @@datadir`
--remove_file $datadir/test/t1.par
drop table t1;
Warnings:
Warning 1017 Can't find file: './test/t1.par' (errno: 2 "No such file or directory")
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p1.MYD
t1#P#p1.MYI
2) If .TRG file is missing, orphan .TRN files don't get removed upon DROP TABLE
--let $datadir= `select @@datadir`
--remove_file $datadir/test/t1.TRG
drop table t1;
db.opt
tr.TRN