[MDEV-23185] CREATE OR REPLACE TABLE is less robust than DROP TABLE + CREATE TABLE Created: 2020-07-15  Updated: 2020-07-15

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.5
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Federico Razzoli Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: create_table

Issue Links:
Relates
relates to MDEV-11412 Ensure that table is truly dropped wh... Closed

 Description   

Starting from 10.5, DROP TABLE works even if a .frm file is missing. But CREATE OR REPLACE TABLE doesn't:

MariaDB [test]> CREATE TABLE x (a int);
Query OK, 0 rows affected (0.009 sec)
 
MariaDB [test]> \! ls -1 /var/lib/mysql/test/x.*
/var/lib/mysql/test/x.frm
/var/lib/mysql/test/x.ibd
MariaDB [test]> \! rm /var/lib/mysql/test/x.frm
MariaDB [test]> CREATE OR REPLACE TABLE x (a int);
ERROR 1813 (HY000): Tablespace for table '`test`.`x`' exists. Please DISCARD the tablespace before IMPORT
MariaDB [test]> DROP TABLE x;
Query OK, 0 rows affected (0.006 sec)

If this is not a bug, please consider it as a feature request.


Generated at Thu Feb 08 09:20:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.