diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 7a3adc89ea9..fad58900002 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1318,6 +1318,10 @@ close_all_tables_for_name(THD *thd, TABLE_SHARE *share, if (table->s->table_cache_key.length == key_length && !memcmp(table->s->table_cache_key.str, key, key_length)) { + /* Inform handler that table will be dropped after close */ + if (table->db_stat) + table->file->extra(HA_EXTRA_PREPARE_FOR_DROP); + /* Does nothing if the table is not locked. This allows one to use this function after a table