summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-03-08 10:15:48 +0100
committerunknown <msvensson@neptunus.(none)>2006-03-08 10:15:48 +0100
commitf491db2119ed75a818a2b767344fb5c57711fa0b (patch)
treec9e13fc06a8aad574201041ed80bdf274c3a680d /sql
parent3cebcd159ea564fc82125633eaf7956432bd3445 (diff)
downloadmariadb-git-f491db2119ed75a818a2b767344fb5c57711fa0b.tar.gz
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''
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_delete.cc2
1 files changed, 2 insertions, 0 deletions
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