List:Commits« Previous MessageNext Message »
From:msvensson Date:March 8 2006 10:15am
Subject:bk commit into 4.1 tree (msvensson:1.2474) BUG#17137
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2474 06/03/08 10:15:48 msvensson@neptunus.(none) +3 -0
  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" 

  mysql-test/t/rpl_trunc_temp.test
    1.1 06/03/08 10:15:44 msvensson@neptunus.(none) +35 -0
    New BitKeeper file ``mysql-test/t/rpl_trunc_temp.test''

  mysql-test/r/rpl_trunc_temp.result
    1.1 06/03/08 10:15:44 msvensson@neptunus.(none) +22 -0
    New BitKeeper file ``mysql-test/r/rpl_trunc_temp.result''

  mysql-test/t/rpl_trunc_temp.test
    1.0 06/03/08 10:15:44 msvensson@neptunus.(none) +0 -0
    BitKeeper file
/home/msvensson/mysql/bug17137/my41-bug17137/mysql-test/t/rpl_trunc_temp.test

  mysql-test/r/rpl_trunc_temp.result
    1.0 06/03/08 10:15:44 msvensson@neptunus.(none) +0 -0
    BitKeeper file
/home/msvensson/mysql/bug17137/my41-bug17137/mysql-test/r/rpl_trunc_temp.result

  sql/sql_delete.cc
    1.139 06/03/08 10:15:43 msvensson@neptunus.(none) +2 -0
    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.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug17137/my41-bug17137

--- 1.138/sql/sql_delete.cc	2005-12-08 21:33:29 +01:00
+++ 1.139/sql/sql_delete.cc	2006-03-08 10:15:43 +01:00
@@ -641,6 +641,8 @@
     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
--- New file ---
+++ mysql-test/r/rpl_trunc_temp.result	06/03/08 10:15:44
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create temporary table t1 (n int);
insert into t1 values(1);
show status like 'Slave_open_temp_tables';
Variable_name	Value
Slave_open_temp_tables	1
delete from t1;
show status like 'Slave_open_temp_tables';
Variable_name	Value
Slave_open_temp_tables	1
truncate t1;
show status like 'Slave_open_temp_tables';
Variable_name	Value
Slave_open_temp_tables	1
show status like 'Slave_open_temp_tables';
Variable_name	Value
Slave_open_temp_tables	0

--- New file ---
+++ mysql-test/t/rpl_trunc_temp.test	06/03/08 10:15:44
source include/master-slave.inc;

#
# Bug#17137 Running "truncate table" on temporary table
# leaves the table open on a slave
#

create temporary table t1 (n int);
insert into t1 values(1);
sync_slave_with_master;
show status like 'Slave_open_temp_tables';

# Perform a delete from temp table
connection master;
delete from t1;
sync_slave_with_master;
show status like 'Slave_open_temp_tables';

# Perform truncate on temp table
connection master;
truncate t1;
sync_slave_with_master;
show status like 'Slave_open_temp_tables';

# Disconnect the master, temp table on slave should dissapear
disconnect master;
--real_sleep 3 # time for DROP to be read by slave
connection slave;
show status like 'Slave_open_temp_tables';


connection master;


# End of 4.1 tests

Thread
bk commit into 4.1 tree (msvensson:1.2474) BUG#17137msvensson8 Mar