1
# BUG#47312: RBR: Disabling key on slave breaks replication:
7
# This test case checks whether disabling a key on a slave breaks
10
# Case #1, shows that while not using ALTER TABLE... DISABLE KEYS and
11
# the slave has no key defined while the master has one, replication
14
# Case #2, shows that before patch for BUG#47312, if defining key on
15
# slave table, and later disable it, replication would break. This
19
-- source include/master-slave.inc
20
-- source include/have_binlog_format_row.inc
23
# Case #1: master has key, but slave has not.
24
# Replication does not break.
28
CREATE TABLE t (a int, b int, c int, key(b));
33
CREATE TABLE t (a int, b int, c int);
37
INSERT INTO t VALUES (1,2,4);
38
INSERT INTO t VALUES (4,3,4);
41
-- sync_slave_with_master
46
-- sync_slave_with_master
49
# Case #2: master has key, slave also has one,
50
# but it gets disabled sometime.
51
# Replication does not break anymore.
53
-- source include/master-slave-reset.inc
56
CREATE TABLE t (a int, b int, c int, key(b));
58
-- sync_slave_with_master
60
ALTER TABLE t DISABLE KEYS;
64
INSERT INTO t VALUES (1,2,4);
65
INSERT INTO t VALUES (4,3,4);
68
-- sync_slave_with_master
73
-- sync_slave_with_master