List:Commits« Previous MessageNext Message »
From:Jon Olav Hauglid Date:December 8 2009 1:22pm
Subject:bzr push into mysql-5.6-next-mr branch (jon.hauglid:3001 to 3002)
View as plain text  
 3002 Jon Olav Hauglid	2009-12-08
      Backport of revno: 2617.62.1
      
      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 
      (If DROP TABLE while there's an active transaction, 
      wrong binlog order) 
      
      Test case added to rpl_innodb.test.

    modified:
      mysql-test/suite/rpl/r/rpl_innodb.result
      mysql-test/suite/rpl/t/rpl_innodb.test
 3001 Jon Olav Hauglid	2009-12-08
      Backport of revno: 2617.56.21
      
      Bug #45066 FLUSH TABLES WITH READ LOCK deadlocks against LOCK TABLE
      
      Test coverage for combinations of LOCK TABLE READ / WRITE and 
      FLUSH TABLES / FLUSH TABLES WITH READ LOCK added to lock.test.
      LOCK and FLUSH are executed sequentially from one connection.

    modified:
      mysql-test/r/lock.result
      mysql-test/t/lock.test
=== modified file 'mysql-test/suite/rpl/r/rpl_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_innodb.result	2008-10-29 13:25:03 +0000
+++ b/mysql-test/suite/rpl/r/rpl_innodb.result	2009-12-08 13:22:26 +0000
@@ -82,3 +82,48 @@ FLUSH LOGS;
 FLUSH LOGS;
 DROP DATABASE mysqltest1;
 End of 5.1 tests
+#
+# Bug#39675 rename tables on innodb tables with pending 
+# transactions causes slave data issue.
+#
+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);
+-------- switch to master1 --------
+RENAME TABLE t1 TO t3, t2 TO t1;;
+-------- switch to master --------
+COMMIT;
+-------- switch to master1 --------
+-------- switch to master --------
+SELECT * FROM t1;
+id	b
+SELECT * FROM t3;
+id	b
+1	1
+2	2
+3	3
+4	4
+-------- switch to slave --------
+SELECT * FROM t1;
+id	b
+SELECT * FROM t3;
+id	b
+1	1
+2	2
+3	3
+4	4
+-------- switch to master --------
+DROP TABLE t1;
+DROP TABLE t3;
+End of 6.0 tests

=== modified file 'mysql-test/suite/rpl/t/rpl_innodb.test'
--- a/mysql-test/suite/rpl/t/rpl_innodb.test	2008-10-29 13:25:03 +0000
+++ b/mysql-test/suite/rpl/t/rpl_innodb.test	2009-12-08 13:22:26 +0000
@@ -120,6 +120,71 @@ connection master;
 FLUSH LOGS;
 
 DROP DATABASE mysqltest1;
--- source include/master-slave-end.inc
 
 --echo End of 5.1 tests
+
+--echo #
+--echo # Bug#39675 rename tables on innodb tables with pending 
+--echo # transactions causes slave data issue.
+--echo #
+
+--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);
+
+--echo -------- switch to master1 --------
+connection master1;
+--send RENAME TABLE t1 TO t3, t2 TO t1;
+
+--echo -------- switch to master --------
+connection master;
+# Need to wait until RENAME is received
+let $wait_condition=
+  SELECT COUNT(*) = 1 FROM information_schema.processlist
+  WHERE info = "RENAME TABLE t1 TO t3, t2 TO t1" and
+  state = "Waiting for table";
+--source include/wait_condition.inc
+
+COMMIT;
+
+--echo -------- switch to master1 --------
+connection master1;
+--reap
+
+--echo -------- switch to master --------
+connection master;
+SELECT * FROM t1;
+SELECT * FROM t3;
+
+sync_slave_with_master;
+
+--echo -------- switch to slave --------
+connection slave;
+SELECT * FROM t1;
+SELECT * FROM t3;
+
+--echo -------- switch to master --------
+connection master;
+DROP TABLE t1;
+DROP TABLE t3;
+
+--echo End of 6.0 tests
+
+--source include/master-slave-end.inc


Attachment: [text/bzr-bundle] bzr/jon.hauglid@sun.com-20091208132226-qgg88mgea4jwu5lj.bundle
Thread
bzr push into mysql-5.6-next-mr branch (jon.hauglid:3001 to 3002) Jon Olav Hauglid8 Dec