2
--source include/master-slave.inc
3
--source include/have_debug.inc
4
--source include/have_binlog_format_row.inc
6
# BUG#11753004: 44360: REPLICATION FAILED
8
## assert that we get an error when checking the
9
## identifiers at the slave (instead of a crash or
10
## different table being updated)
12
--let $t1= t1_11753004
13
--let $t2= t2_11753004
14
--let $t2_ign= t2_11753004_ign
16
## test #1: assert that we get an error raised when multiple
17
## tables in the same RBR statement are mapped with the
20
--eval CREATE TABLE $t1 (c1 INT)
21
--eval CREATE TABLE $t2 (c1 INT)
22
--eval INSERT INTO $t1 VALUES (1)
23
--eval INSERT INTO $t2 VALUES (2)
25
--sync_slave_with_master
26
call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
28
# stop the slave and inject corruption
29
--source include/stop_slave.inc
30
SET @save_debug= @@global.debug;
31
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
32
--source include/start_slave.inc
34
# both tables get mapped to 0 (in a way, simulating scenario
35
# originated by BUG#56226)
36
--eval UPDATE $t1, $t2 SET $t1.c1=3, $t2.c1=4 WHERE $t1.c1=1 OR $t2.c1=2
39
# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
40
--let $slave_sql_errno=1593
41
--source include/wait_for_slave_sql_error.inc
42
--source include/stop_slave.inc
45
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
46
--source include/start_slave.inc
48
--source include/rpl_reset.inc
49
--eval DROP TABLE $t1, $t2
50
--sync_slave_with_master
52
## test #2: assert that ignored tables that may have been mapped
53
## with the same identifier are skipped, thus no error
57
--source include/stop_slave.inc
58
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
59
--source include/start_slave.inc
60
--source include/rpl_reset.inc
62
--eval CREATE TABLE $t1 (c1 INT)
63
--eval CREATE TABLE $t2_ign (c1 INT)
64
--eval INSERT INTO $t1 VALUES (1)
65
--eval INSERT INTO $t2_ign VALUES (2)
66
--eval UPDATE $t1, $t2_ign SET $t1.c1=3, $t2_ign.c1=4 WHERE $t1.c1=1 OR $t2_ign.c1=2
68
# must not raise error as second table is filtered
69
--sync_slave_with_master
72
## test #3: check that BINLOG statements will also raise an
73
## error if containing table map events mapping different
74
## tables to same table identifier.
76
CREATE TABLE t1 (c1 INT);
77
CREATE TABLE t2 (c1 INT);
79
INSERT INTO t1 VALUES (1);
80
INSERT INTO t2 VALUES (1);
84
SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
85
AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
88
#110708 12:21:44 server id 1 end_log_pos 774 Table_map: `test`.`t1` mapped to number 66
90
#110708 12:21:44 server id 1 end_log_pos 815 Table_map: `test`.`t2` mapped to number 67
92
#110708 12:21:44 server id 1 end_log_pos 855 Update_rows: table id 66
94
#110708 12:21:44 server id 1 end_log_pos 895 Update_rows: table id 67 flags: STMT_END_F
95
SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
96
--error ER_SLAVE_FATAL_ERROR
98
SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
99
SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
100
SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
101
SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
108
SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
110
--eval DROP TABLE $t1
111
--eval DROP TABLE $t2_ign
112
--sync_slave_with_master
113
SET GLOBAL debug= @save_debug;
115
--source include/rpl_end.inc