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;
9
CREATE TABLE t1(a INT PRIMARY KEY);
11
==== Test: SQL thread sees 'INSERT' of existing key ====
12
---- Prepare slave so that it will get duplicate key error ----
13
INSERT INTO t1 VALUES (1);
14
---- Insert rows on master ----
16
INSERT INTO t1 VALUES (1);
21
---- Wait until slave stops with an error ----
22
Last_SQL_Error = Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)' (expected "duplicate key" error)
26
---- Resolve the conflict on the slave and restart SQL thread ----
27
DELETE FROM t1 WHERE a = 1;
28
START SLAVE SQL_THREAD;
29
---- Sync slave and verify that there is no error ----
30
Last_SQL_Error = '' (expected no error)
34
==== Test: SQL thread sees 'DELETE' of non-existing row ====
35
---- On master, insert two rows, the second with binlogging off ----
38
INSERT INTO t1 VALUES (1);
40
DELETE FROM t1 WHERE a = 1;
41
---- On master, remove the row that does not exist on slave ----
43
DELETE FROM t1 WHERE a = 1;
47
---- Sync slave and verify that there is no error ----
48
Last_SQL_Error = (expected no error)