Skip to content
Permalink
Browse files
MDEV-23549 CREATE fails after DROP without FRM
Related to 7c2ba9e: ha_table_exists() is replaced by
dd_frm_type(). ha_table_exists() checked the existence of share and
that succeeded to enter the execution branch of ha_delete_table()
where tdc_remove_table() was called. Now it is skipped because
dd_frm_type() returns TABLE_TYPE_UNKNOWN. Fix it by calling
tdc_remove_table() in this case as well.
  • Loading branch information
midenok committed Sep 7, 2020
1 parent 92ffab3 commit 9842ed4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
@@ -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;
@@ -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;
@@ -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
{

0 comments on commit 9842ed4

Please sign in to comment.