diff options
author | Luis Soares <luis.soares@sun.com> | 2010-06-03 00:04:27 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2010-06-03 00:04:27 +0100 |
commit | 20fc48fc38f18b3ad246e171224f23562f59a355 (patch) | |
tree | f5722e1306932790519b3449805f0ddc489c1e91 /mysql-test/suite/rpl | |
parent | f448197d648dba77ea1ce89c086b69ccc9ff67f6 (diff) | |
parent | 1b27674429a5c6f639eeff07ce952de3703d2f10 (diff) | |
download | mariadb-git-20fc48fc38f18b3ad246e171224f23562f59a355.tar.gz |
BUG 53893: automerged bug branch into mysql-5.1-bugteam latest.
Diffstat (limited to 'mysql-test/suite/rpl')
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_row_find_row.result (renamed from mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result) | 12 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_row_find_row.test (renamed from mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test) | 31 |
2 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result b/mysql-test/suite/rpl/r/rpl_row_find_row.result index 01e3dfd6508..69516b47b7d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result +++ b/mysql-test/suite/rpl/r/rpl_row_find_row.result @@ -24,3 +24,15 @@ INSERT INTO t VALUES (1,2,4); INSERT INTO t VALUES (4,3,4); DELETE FROM t; DROP TABLE t; +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; +CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2)); +INSERT INTO t1(c1,c2) VALUES(1,1); +INSERT INTO t1(c1,c2) VALUES(1,2); +UPDATE t1 SET c1=1000 WHERE c2=2; +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test b/mysql-test/suite/rpl/t/rpl_row_find_row.test index 1d7e134f4f4..9163ab54406 100644 --- a/mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test +++ b/mysql-test/suite/rpl/t/rpl_row_find_row.test @@ -71,3 +71,34 @@ DELETE FROM t; DROP TABLE t; -- sync_slave_with_master + +# +# BUG#53893: RBR: nullable unique key can lead to out-of-sync slave +# + +# +# We insert two rows. Both with part of UNIQUE KEY set to null. +# Then we update the last row inserted. On master the correct +# row is updated. On the slave the wrong row would be updated +# because the engine would look it up by the NULL Unique KEY. +# As a consquence, the wrong row would be updated. +# + +-- connection master +-- source include/master-slave-reset.inc +-- connection master + +CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2)); +INSERT INTO t1(c1,c2) VALUES(1,1); +INSERT INTO t1(c1,c2) VALUES(1,2); +UPDATE t1 SET c1=1000 WHERE c2=2; +-- sync_slave_with_master + +-- let $diff_table_1=master:test.t1 +-- let $diff_table_2=slave:test.t1 +-- source include/diff_tables.inc + +-- connection master +DROP TABLE t1; +-- sync_slave_with_master + |