From: Date: March 30 2006 5:04pm Subject: bk commit into 5.0 tree (aelkin:1.2122) BUG#17284 List-Archive: http://lists.mysql.com/commits/4327 X-Bug: 17284 Message-Id: <200603301504.k2UF4E0X029498@dsl-hkigw8-feb0de00-199.dhcp.inet.fi> Below is the list of changes that have just been committed into a local 5.0 repository of elkin. When elkin 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.2122 06/03/30 18:04:08 aelkin@stripped +3 -0 Bug#17284 erroneous temp table cleanup on slave. Idea of the fix is for master to send FD event with `created' as 0 to reconnecting slave (upon slave_net_timeout, no master crash) to avoid destroying temp tables. In a case of a connect by slave to the master after its crash temp tables have been already cleaned up so that slave can not keep `orphan' temp tables. sql/sql_repl.cc 1.148 06/03/30 18:04:03 aelkin@stripped +6 -0 Storing zero for assigning to `created' of FD event on the slave. mysql-test/t/rpl_temporary.test 1.16 06/03/30 18:04:03 aelkin@stripped +23 -0 Specific for temp table check on slave upon its reconnect is added. mysql-test/r/rpl_temporary.result 1.19 06/03/30 18:04:03 aelkin@stripped +12 -0 results # 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: aelkin # Host: dsl-hkigw8-feb0de00-199.dhcp.inet.fi # Root: /usr_rh9/home/elkin.rh9/MySQL/FIXES/5.0.20-bug17284-temp_table --- 1.147/sql/sql_repl.cc 2006-01-03 18:54:37 +02:00 +++ 1.148/sql/sql_repl.cc 2006-03-30 18:04:03 +03:00 @@ -466,6 +466,12 @@ (rli->group_master_log_pos) */ int4store((char*) packet->ptr()+LOG_POS_OFFSET+1, 0); + /* + if reconnect master sends FD event with `created' as 0 + to avoid destroying temp tables. + */ + int4store((char*) packet->ptr()+LOG_EVENT_MINIMAL_HEADER_LEN+ + ST_CREATED_OFFSET+1, (ulong) 0); /* send it */ if (my_net_write(net, (char*)packet->ptr(), packet->length())) { --- 1.18/mysql-test/r/rpl_temporary.result 2005-03-23 20:18:16 +02:00 +++ 1.19/mysql-test/r/rpl_temporary.result 2006-03-30 18:04:03 +03:00 @@ -89,3 +89,15 @@ 7 drop table t1,t2; create temporary table t3 (f int); +set global slave_net_timeout=10; +stop slave; +start slave; +create temporary table t4 (f int); +create table t5 (f int); +insert into t4 values (1); +insert into t5 select * from t4; +select * from t5 /* must be 1 after reconnect */; +f +1 +drop temporary table t4; +drop table t5; --- 1.15/mysql-test/t/rpl_temporary.test 2005-07-28 16:12:37 +03:00 +++ 1.16/mysql-test/t/rpl_temporary.test 2006-03-30 18:04:03 +03:00 @@ -129,6 +129,29 @@ create temporary table t3 (f int); sync_with_master; +# +# Bug#17284 erroneous temp table cleanup on slave +# +connection slave; +set global slave_net_timeout=10; +stop slave; +start slave; + +connection master; +create temporary table t4 (f int); +create table t5 (f int); +insert into t4 values (1); +--sleep 15 +insert into t5 select * from t4; +sync_with_master; + +connection slave; +select * from t5 /* must be 1 after reconnect */; + +connection master; +drop temporary table t4; +drop table t5; + # The server will now close done # End of 4.1 tests