mariadb/mysql-test/suite/rpl/r/rpl_idempotency.result
2018-12-30 18:30:29 +01:00

103 lines
2.3 KiB
Text

include/master-slave.inc
[connection master]
call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* error.* 1032");
call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* error.* 1451");
call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* error.* 1452");
call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* error.* 1062");
call mtr.add_suppression("Can't find record in 't1'");
call mtr.add_suppression("Can't find record in 't2'");
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
INSERT INTO t2 VALUES (-1),(-2),(-3);
connection slave;
SET @old_slave_exec_mode= @@global.slave_exec_mode;
SET @@global.slave_exec_mode= IDEMPOTENT;
connection slave;
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
connection master;
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
SELECT * FROM t1 ORDER BY a;
a
-3
-1
SELECT * FROM t2 ORDER BY a;
a
-3
-1
connection slave;
SELECT * FROM t1 ORDER BY a;
a
-3
-1
SELECT * FROM t2 ORDER BY a;
a
-3
-1
include/check_slave_no_error.inc
INSERT IGNORE INTO t1 VALUES (-2);
connection master;
INSERT IGNORE INTO t1 VALUES (-2);
SELECT * FROM t1 ORDER BY a;
a
-3
-2
-1
connection slave;
SELECT * FROM t1 ORDER BY a;
a
-3
-2
-1
include/check_slave_no_error.inc
connection slave;
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
SELECT * FROM t1 ORDER BY a;
a
-3
-2
1
SELECT * FROM t2 ORDER BY a;
a
-3
1
connection slave;
SELECT * FROM t1 ORDER BY a;
a
-3
-2
1
SELECT * FROM t2 ORDER BY a;
a
-3
1
include/check_slave_no_error.inc
connection slave;
drop table t1, t2;
connection master;
DROP TABLE t1, t2;
connection slave;
include/check_slave_no_error.inc
create database d;
create database e;
connection master;
create database d;
create database if not exists e;
connection slave;
include/check_slave_no_error.inc
drop database d;
drop database e;
connection master;
drop database d;
drop database if exists e;
connection slave;
include/check_slave_no_error.inc
SET @@global.slave_exec_mode= @old_slave_exec_mode;
include/rpl_end.inc