summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authoringo@mysql.com <>2004-06-24 15:06:56 +0200
committeringo@mysql.com <>2004-06-24 15:06:56 +0200
commit18cd61d0d0cd0cd6079bb14009dbbc791aa4c7a5 (patch)
tree3e35aa94e3031d9c40bbf2f3b31a48fb7979516e /sql/sql_base.cc
parent8ff57ee4697c89f411d896cc87027b1381d8c2ee (diff)
downloadmariadb-git-18cd61d0d0cd0cd6079bb14009dbbc791aa4c7a5.tar.gz
bug#3565 - HANDLER and FLUSH TABLE/TABLES deadlock.
Redesigned the handler close functions so that they are usable at different places where waiting for closing tables is done.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index c4cad8a8786..7b1b3cc1b7a 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -389,6 +389,7 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
thd->proc_info="Flushing tables";
close_old_data_files(thd,thd->open_tables,1,1);
+ mysql_ha_close_list(thd, tables);
bool found=1;
/* Wait until all threads has closed all the tables we had locked */
DBUG_PRINT("info", ("Waiting for others threads to close their open tables"));
@@ -857,6 +858,9 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
DBUG_RETURN(0);
}
+ /* close handler tables which are marked for flush */
+ mysql_ha_close_list(thd, (TABLE_LIST*) NULL, /*flushed*/ 1);
+
for (table=(TABLE*) hash_search(&open_cache,(byte*) key,key_length) ;
table && table->in_use ;
table = (TABLE*) hash_next(&open_cache,(byte*) key,key_length))
@@ -1222,6 +1226,7 @@ bool wait_for_tables(THD *thd)
{
thd->some_tables_deleted=0;
close_old_data_files(thd,thd->open_tables,0,dropping_tables != 0);
+ mysql_ha_close_list(thd, (TABLE_LIST*) NULL, /*flushed*/ 1);
if (!table_is_used(thd->open_tables,1))
break;
(void) pthread_cond_wait(&COND_refresh,&LOCK_open);