diff options
author | Michael Widenius <monty@askmonty.org> | 2010-12-04 12:27:51 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-12-04 12:27:51 +0200 |
commit | 7fc608619260d6f74e70b990cdf48fff15e9e115 (patch) | |
tree | 1782e25c0e1b1472fccd2446535d0314e818be32 /mysql-test | |
parent | 91a72ee314ce6b0ac7adfc6546390435c9ba164f (diff) | |
parent | 8938ed57a4c533f3e56c5ac5ef5889c7944f7e22 (diff) | |
download | mariadb-git-7fc608619260d6f74e70b990cdf48fff15e9e115.tar.gz |
Automatic merge with 5.1-release
Diffstat (limited to 'mysql-test')
5 files changed, 97 insertions, 0 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test index 86885a14f94..8d2f6c32233 100644 --- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test +++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test @@ -241,3 +241,60 @@ DROP TABLE t1; DROP TABLE t2; SET SQL_MODE=''; sync_slave_with_master; + +# +# Bug#54201: "SET INSERT_ID" event must be ignored if corresponding event is +# ignored. +# +connection master; + +CREATE TABLE t1(s VARCHAR(10)) ENGINE=myisam; +# -slave.opt has --replicate-ignore-table=test.t_ignored1 +CREATE TABLE t_ignored1(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam; +sync_slave_with_master; + +connection slave; + +CREATE TABLE test.slave_only(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam; +INSERT INTO slave_only VALUES(NULL); +CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO slave_only VALUES(NULL); + +connection master; + +INSERT INTO t_ignored1 VALUES(NULL); +INSERT INTO t1 VALUES('s'); +UPDATE t1 SET s='s1'; + +# With Bug#54201, slave stops with duplicate key error here due to trigger +# using the insert_id from insert on master into t1_ignored1 +sync_slave_with_master; +connection slave; +SELECT * FROM t1; + +connection master; +CREATE TABLE t_ignored2(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam; +sync_slave_with_master; + +connection slave; +STOP SLAVE; +# Ignore the next INSERT into t_ignored2 and the INSERT_ID event just before it. +SET GLOBAL sql_slave_skip_counter = 2; +START SLAVE; + +connection master; +INSERT INTO t_ignored2 VALUES(NULL); +UPDATE t1 SET s='s2'; +sync_slave_with_master; + +connection slave; +SELECT * FROM t1; +SHOW TABLES LIKE 't\_ignored_'; +SELECT * FROM t_ignored2; +DROP TABLE slave_only; + +connection master; +DROP TABLE t1; +DROP TABLE t_ignored1; +DROP TABLE t_ignored2; + +sync_slave_with_master; diff --git a/mysql-test/suite/innodb/t/innodb_bug38231.test b/mysql-test/suite/innodb/t/innodb_bug38231.test index 1611cb56203..5021f23d07e 100644 --- a/mysql-test/suite/innodb/t/innodb_bug38231.test +++ b/mysql-test/suite/innodb/t/innodb_bug38231.test @@ -76,6 +76,11 @@ UNLOCK TABLES; UNLOCK TABLES; -- connection con3 +# +# We may get a timeout error here if the tables are locked in a different +# order than expected. This is ok as the purpose of this patch is to ensure +# we don't get a crash in the previous unlock tables. +-- error 0, 1205 -- reap UNLOCK TABLES; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test b/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test index be588474bc1..23d8061c9da 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test @@ -72,6 +72,11 @@ UNLOCK TABLES; # clean up -- connection con2 +# +# We may get a timeout error here if the tables are locked in a different +# order than expected. This is ok as the purpose of this patch is to ensure +# we don't get a crash in the previous unlock tables. +-- error 0, 1205 -- reap UNLOCK TABLES; diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result index 831e9b5c8b5..9fcd9bbd54c 100644 --- a/mysql-test/suite/rpl/r/rpl_auto_increment.result +++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result @@ -312,3 +312,32 @@ Comparing tables master:test.t2 and slave:test.t2 DROP TABLE t1; DROP TABLE t2; SET SQL_MODE=''; +CREATE TABLE t1(s VARCHAR(10)) ENGINE=myisam; +CREATE TABLE t_ignored1(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam; +CREATE TABLE test.slave_only(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam; +INSERT INTO slave_only VALUES(NULL); +CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO slave_only VALUES(NULL); +INSERT INTO t_ignored1 VALUES(NULL); +INSERT INTO t1 VALUES('s'); +UPDATE t1 SET s='s1'; +SELECT * FROM t1; +s +s1 +CREATE TABLE t_ignored2(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam; +STOP SLAVE; +SET GLOBAL sql_slave_skip_counter = 2; +START SLAVE; +INSERT INTO t_ignored2 VALUES(NULL); +UPDATE t1 SET s='s2'; +SELECT * FROM t1; +s +s2 +SHOW TABLES LIKE 't\_ignored_'; +Tables_in_test (t\_ignored_) +t_ignored2 +SELECT * FROM t_ignored2; +id +DROP TABLE slave_only; +DROP TABLE t1; +DROP TABLE t_ignored1; +DROP TABLE t_ignored2; diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt new file mode 100644 index 00000000000..79ed6f96a4a --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt @@ -0,0 +1 @@ +--replicate-ignore-table=test.t_ignored1 |