#At file:///export/home/z/mysql-azalea-bugfixing-bug39675/ based on revid:holyfoot@stripped
2812 Jon Olav Hauglid 2009-07-01
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 rpl_innodb.test.
modified:
mysql-test/suite/rpl/r/rpl_innodb.result
mysql-test/suite/rpl/t/rpl_innodb.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-07-01 08:22:02 +0000
@@ -82,3 +82,44 @@ 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);
+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/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-07-01 08:22:02 +0000
@@ -120,6 +120,68 @@ 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);
+
+connection master1;
+--send RENAME TABLE t1 TO t3, t2 TO t1;
+
+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";
+--source include/wait_condition.inc
+
+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;
+
+sync_slave_with_master;
+
+--echo End of 6.0 tests
+
+-- source include/master-slave-end.inc
Attachment: [text/bzr-bundle] bzr/jon.hauglid@sun.com-20090701082202-jcknc4nam3ejaaju.bundle
| Thread |
|---|
| • bzr commit into mysql-5.4 branch (jon.hauglid:2812) Bug#39675 | Jon Olav Hauglid | 1 Jul |