From f491db2119ed75a818a2b767344fb5c57711fa0b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Mar 2006 10:15:48 +0100 Subject: Bug#17137 Running "truncate table" on temporary table leaves the table open on a slave - Decrease "slave_open_temp_tables" during reopen of truncated table. - Add test "rpl_trunc_temp" sql/sql_delete.cc: Decrease "slave_open_temp_tables" after temporary table has been closed, it will be increased again when the temp table is reopened after it's been truncated. mysql-test/r/rpl_trunc_temp.result: New BitKeeper file ``mysql-test/r/rpl_trunc_temp.result'' mysql-test/t/rpl_trunc_temp.test: New BitKeeper file ``mysql-test/t/rpl_trunc_temp.test'' --- sql/sql_delete.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql') diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 203173f52f4..b085d37be78 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -641,6 +641,8 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) strmov(path,table->path); *table_ptr= table->next; // Unlink table from list close_temporary(table,0); + if (thd->slave_thread) + --slave_open_temp_tables; *fn_ext(path)=0; // Remove the .frm extension ha_create_table(path, &create_info,1); // We don't need to call invalidate() because this table is not in cache -- cgit v1.2.1