List:Commits« Previous MessageNext Message »
From:Jon Olav Hauglid Date:June 29 2009 9:39am
Subject:bzr commit into mysql-5.4 branch (jon.hauglid:2812) Bug#39675
View as plain text  
#At file:///export/home/z/mysql-azalea-bugfixing-bug39675/ based on revid:holyfoot@stripped

 2812 Jon Olav Hauglid	2009-06-29
      Bug #39675 rename tables on innodb tables with pending 
                 transactions causes slave data issue
      
      Bug was already fixed as part of patch for Bug#989.
      Test case added to rename.test.

    modified:
      mysql-test/r/rename.result
      mysql-test/t/rename.test
=== modified file 'mysql-test/r/rename.result'
--- a/mysql-test/r/rename.result	2006-11-11 11:59:14 +0000
+++ b/mysql-test/r/rename.result	2009-06-29 09:39:13 +0000
@@ -66,3 +66,50 @@ ERROR 42S01: Table 'v1' already exists
 drop view v1;
 drop table t1;
 End of 5.0 tests
+#
+# Bug#39675 rename tables on innodb tables with pending 
+# transactions causes slave data issue
+#
+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;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+CREATE TABLE t1 (
+id INT PRIMARY KEY auto_increment,
+b INT DEFAULT NULL
+) ENGINE=InnoDB;
+CREATE TABLE t2 (
+id INT PRIMARY KEY auto_increment,
+b INT DEFAULT NULL
+) ENGINE=InnoDB;
+INSERT INTO t1 (b) VALUES (1),(2),(3);
+BEGIN;
+INSERT INTO t1(b) VALUES (4);
+RENAME TABLE t1 TO t3, t2 TO t1;;
+COMMIT;
+# Master 
+SELECT * FROM t1;
+id	b
+SELECT * FROM t3;
+id	b
+1	1
+2	2
+3	3
+4	4
+# Slave
+SELECT * FROM t1;
+id	b
+SELECT * FROM t3;
+id	b
+1	1
+2	2
+3	3
+4	4
+DROP TABLE t1;
+DROP TABLE t3;
+# End of 6.0 tests

=== modified file 'mysql-test/t/rename.test'
--- a/mysql-test/t/rename.test	2009-02-11 09:27:52 +0000
+++ b/mysql-test/t/rename.test	2009-06-29 09:39:13 +0000
@@ -97,3 +97,64 @@ drop table t1;
 
 --source include/wait_until_count_sessions.inc
 
+--echo #
+--echo # Bug#39675 rename tables on innodb tables with pending 
+--echo # transactions causes slave data issue
+--echo #
+
+--source include/master-slave.inc
+--source include/have_innodb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+CREATE TABLE t1 (
+  id INT PRIMARY KEY auto_increment,
+  b INT DEFAULT NULL
+) ENGINE=InnoDB;
+
+CREATE TABLE t2 (
+  id INT PRIMARY KEY auto_increment,
+  b INT DEFAULT NULL
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (b) VALUES (1),(2),(3);
+
+BEGIN;
+INSERT INTO t1(b) VALUES (4);
+
+connection master1;
+--send RENAME TABLE t1 TO t3, t2 TO t1;
+
+connection master;
+COMMIT;
+
+connection master1;
+--reap
+
+-- echo # Master 
+connection master;
+SELECT * FROM t1;
+SELECT * FROM t3;
+
+sync_slave_with_master;
+
+-- echo # Slave
+connection slave;
+SELECT * FROM t1;
+SELECT * FROM t3;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t3;
+
+disconnect slave1;
+disconnect slave;
+disconnect master1;
+disconnect master;
+connection default;
+
+--echo # End of 6.0 tests


Attachment: [text/bzr-bundle] bzr/jon.hauglid@sun.com-20090629093913-t8f1yedg88odxt54.bundle
Thread
bzr commit into mysql-5.4 branch (jon.hauglid:2812) Bug#39675Jon Olav Hauglid29 Jun
  • Re: bzr commit into mysql-5.4 branch (jon.hauglid:2812) Bug#39675Konstantin Osipov1 Jul