diff options
| -rw-r--r-- | mysql-test/main/drop_table_force.result | 9 | ||||
| -rw-r--r-- | mysql-test/main/drop_table_force.test | 11 | ||||
| -rw-r--r-- | sql/sql_table.cc | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/main/drop_table_force.result b/mysql-test/main/drop_table_force.result index d3142887ade..622589eb3b9 100644 --- a/mysql-test/main/drop_table_force.result +++ b/mysql-test/main/drop_table_force.result @@ -120,3 +120,12 @@ flush tables; drop table t2; ERROR 42S02: Unknown table 'test.t2' db.opt +# +# MDEV-23549 CREATE fails after DROP without FRM +# +create table t1 (a int); +select * from t1; +a +drop table t1; +create table t1 (a int); +drop table t1; diff --git a/mysql-test/main/drop_table_force.test b/mysql-test/main/drop_table_force.test index 518b4e754c3..f3073e3b67d 100644 --- a/mysql-test/main/drop_table_force.test +++ b/mysql-test/main/drop_table_force.test @@ -213,3 +213,14 @@ flush tables; --error ER_BAD_TABLE_ERROR drop table t2; --list_files $DATADIR/test/ + +--echo # +--echo # MDEV-23549 CREATE fails after DROP without FRM +--echo # +create table t1 (a int); +select * from t1; +--remove_file $datadir/test/t1.frm + +drop table t1; +create table t1 (a int); +drop table t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 57045c251a7..15d190c3139 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2443,6 +2443,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, was_table|= wrong_drop_sequence; local_non_tmp_error= 1; error= table_type == TABLE_TYPE_UNKNOWN ? ENOENT : -1; + tdc_remove_table(thd, db.str, table_name.str); } else { |
