~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# BUG#47312: RBR: Disabling key on slave breaks replication:
 
2
# HA_ERR_WRONG_INDEX
 
3
#
 
4
# Description
 
5
# ===========
 
6
#   
 
7
#   This test case checks whether disabling a key on a slave breaks
 
8
#   replication or not.
 
9
#   
 
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
 
12
#   won't break.
 
13
#
 
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
 
16
#   has been fixed.
 
17
 
18
 
 
19
-- source include/master-slave.inc
 
20
-- source include/have_binlog_format_row.inc
 
21
 
 
22
#
 
23
# Case #1: master has key, but slave has not. 
 
24
#          Replication does not break.
 
25
 
26
 
 
27
SET SQL_LOG_BIN=0;
 
28
CREATE TABLE t (a int, b int, c int, key(b));
 
29
SET SQL_LOG_BIN=1;
 
30
 
 
31
-- connection slave
 
32
 
 
33
CREATE TABLE t (a int, b int, c int);
 
34
 
 
35
-- connection master
 
36
 
 
37
INSERT INTO t VALUES (1,2,4);
 
38
INSERT INTO t VALUES (4,3,4);
 
39
DELETE FROM t;
 
40
 
 
41
-- sync_slave_with_master
 
42
 
 
43
-- connection master
 
44
DROP TABLE t;
 
45
 
 
46
-- sync_slave_with_master
 
47
 
 
48
#
 
49
# Case #2: master has key, slave also has one, 
 
50
#          but it gets disabled sometime.
 
51
#          Replication does not break anymore.
 
52
 
53
-- source include/master-slave-reset.inc
 
54
-- connection master
 
55
 
 
56
CREATE TABLE t (a int, b int, c int, key(b));
 
57
 
 
58
-- sync_slave_with_master
 
59
 
 
60
ALTER TABLE t DISABLE KEYS;
 
61
 
 
62
-- connection master
 
63
 
 
64
INSERT INTO t VALUES (1,2,4);
 
65
INSERT INTO t VALUES (4,3,4);
 
66
DELETE FROM t;
 
67
 
 
68
-- sync_slave_with_master
 
69
 
 
70
-- connection master
 
71
DROP TABLE t;
 
72
 
 
73
-- sync_slave_with_master