From 2f7a8770a91bd4feac00b08251966cd27b5c75ae Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Thu, 10 Dec 2009 16:43:04 +0300 Subject: [PATCH] Backport of: 2630.16.14 Sergei Golubchik 2008-08-25 fixed a crash in partition tests introduced by HA_EXTRA_PREPARE_FOR_DROP patch sql/sql_base.cc: Don't call ::extra() for closed tables. --- sql/sql_base.cc | 4 ++++ 1 file changed, 4 insertions(+) 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