2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
7
call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
8
call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
9
call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
1
include/master-slave.inc
3
call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032");
4
call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
5
call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
6
call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
10
7
SET @old_slave_exec_mode= @@global.slave_exec_mode;
11
8
CREATE TABLE t1 (a INT PRIMARY KEY);
12
9
CREATE TABLE t2 (a INT);
37
INSERT IGNORE INTO t1 VALUES (-2);
38
INSERT IGNORE INTO t1 VALUES (-2);
39
SELECT * FROM t1 ORDER BY a;
44
SELECT * FROM t1 ORDER BY a;
51
UPDATE t1 SET a = 1 WHERE a = -1;
52
UPDATE t2 SET a = 1 WHERE a = -1;
53
UPDATE t1 SET a = 1 WHERE a = -1;
54
UPDATE t2 SET a = 1 WHERE a = -1;
55
SELECT * FROM t1 ORDER BY a;
60
SELECT * FROM t2 ORDER BY a;
64
SELECT * FROM t1 ORDER BY a;
69
SELECT * FROM t2 ORDER BY a;
32
include/check_slave_no_error.inc
33
INSERT IGNORE INTO t1 VALUES (-2);
34
INSERT IGNORE INTO t1 VALUES (-2);
35
SELECT * FROM t1 ORDER BY a;
40
SELECT * FROM t1 ORDER BY a;
45
include/check_slave_no_error.inc
46
UPDATE t1 SET a = 1 WHERE a = -1;
47
UPDATE t2 SET a = 1 WHERE a = -1;
48
UPDATE t1 SET a = 1 WHERE a = -1;
49
UPDATE t2 SET a = 1 WHERE a = -1;
50
SELECT * FROM t1 ORDER BY a;
55
SELECT * FROM t2 ORDER BY a;
59
SELECT * FROM t1 ORDER BY a;
64
SELECT * FROM t2 ORDER BY a;
68
include/check_slave_no_error.inc
76
70
select @@global.slave_exec_mode /* must be IDEMPOTENT */;
77
71
@@global.slave_exec_mode
161
154
delete from ti1 where b=3;
162
155
insert into ti2 set a=3, b=3 /* offending write event */;
163
156
*** slave must stop (Trying to insert an invalid foreign key)
157
include/wait_for_slave_sql_error.inc [errno=1452]
166
158
select * from ti2 order by b /* must be (2,2) */;
181
173
insert into ti1 set b=1;
182
174
insert into ti1 set b=1 /* offending write event */;
183
175
*** slave must stop (Trying to insert a dupliacte key)
176
include/wait_for_slave_sql_error.inc [errno=1062]
186
177
set foreign_key_checks= 0;
187
178
delete from ti1 where b=1;
188
179
set foreign_key_checks= 1;
197
188
DELETE FROM t2 WHERE a = -2;
198
189
DELETE FROM t1 WHERE a = -2;
199
190
*** slave must stop (Key was not found)
191
include/wait_for_slave_sql_error.inc [errno=1032]
202
192
set global slave_exec_mode='IDEMPOTENT';
203
193
start slave sql_thread;
204
194
set global slave_exec_mode='STRICT';
205
195
DELETE FROM t2 WHERE a = -2;
206
196
*** slave must stop (Key was not found)
209
set global slave_exec_mode='IDEMPOTENT';
210
start slave sql_thread;
211
set global slave_exec_mode='STRICT';
212
UPDATE t1 SET a = 1 WHERE a = -1;
213
UPDATE t2 SET a = 1 WHERE a = -1;
214
UPDATE t1 SET a = 1 WHERE a = -1;
215
*** slave must stop (Key was not found)
218
set global slave_exec_mode='IDEMPOTENT';
219
start slave sql_thread;
220
set global slave_exec_mode='STRICT';
221
UPDATE t2 SET a = 1 WHERE a = -1;
222
*** slave must stop (Key was not found)
197
include/wait_for_slave_sql_error.inc [errno=1032]
198
set global slave_exec_mode='IDEMPOTENT';
199
start slave sql_thread;
200
set global slave_exec_mode='STRICT';
201
UPDATE t1 SET a = 1 WHERE a = -1;
202
UPDATE t2 SET a = 1 WHERE a = -1;
203
UPDATE t1 SET a = 1 WHERE a = -1;
204
*** slave must stop (Key was not found)
205
include/wait_for_slave_sql_error.inc [errno=1032]
206
set global slave_exec_mode='IDEMPOTENT';
207
start slave sql_thread;
208
set global slave_exec_mode='STRICT';
209
UPDATE t2 SET a = 1 WHERE a = -1;
210
*** slave must stop (Key was not found)
211
include/wait_for_slave_sql_error.inc [errno=1032]
225
212
set global slave_exec_mode='IDEMPOTENT';
226
213
start slave sql_thread;
227
214
SET @@global.slave_exec_mode= @old_slave_exec_mode;
228
215
set @@session.binlog_format= @save_binlog_format;
229
216
drop table t1,t2,ti2,ti1;