mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 06:44:16 +01:00
d8d6db6f78
without PK Bug#31609 Not all RBR slave errors reported as errors bug#32468 delete rows event on a table with foreign key constraint fails The first two bugs comprise idempotency issues. First, there was no error code reported under conditions of the bug description although the slave sql thread halted. Second, executions were different with and without presence of prim key in the table. Third, there was no way to instruct the slave whether to ignore an error and skip to the following event or to halt. Fourth, there are handler errors which might happen due to idempotent applying of binlog but those were not listed among the "idempotent" error list. All the named issues are addressed. Wrt to the 3rd, there is the new global system variable, changeble at run time, which controls the slave sql thread behaviour. The new variable allows further extensions to mimic the sql_mode session/global variable. To address the 4th, the new bug#32468 had to be fixed as it was staying in the way.
52 lines
1.4 KiB
Text
52 lines
1.4 KiB
Text
# Originally taken from rpl_mystery22.test,
|
|
# but this row-based-replication test has a totally different spirit:
|
|
# slave will not stop because of dup key,
|
|
# instead we test if it does overwrite the dup key
|
|
# as expected.
|
|
-- source include/have_binlog_format_row.inc
|
|
-- source include/master-slave.inc
|
|
|
|
# first, cause a duplicate key problem on the slave
|
|
create table t1(n int auto_increment primary key, s char(10));
|
|
sync_slave_with_master;
|
|
|
|
# bug#31552/31609 idempotency is not default any longer
|
|
# so that the declared in heading comments aim of the test
|
|
# should be backed up with explicit setting of the slave mode
|
|
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
|
|
|
insert into t1 values (2,'old');
|
|
connection master;
|
|
insert into t1 values(NULL,'new');
|
|
insert into t1 values(NULL,'new');
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
select * from t1 order by n;
|
|
delete from t1 where n = 2;
|
|
--disable_warnings
|
|
start slave;
|
|
--enable_warnings
|
|
sync_with_master;
|
|
stop slave;
|
|
connection master;
|
|
create table t2(n int);
|
|
drop table t2;
|
|
insert into t1 values(NULL,'new');
|
|
# what happens when we delete a row which does not exist on slave?
|
|
set sql_log_bin=0;
|
|
insert into t1 values(NULL,'new');
|
|
set sql_log_bin=1;
|
|
delete from t1 where n=4;
|
|
save_master_pos;
|
|
connection slave;
|
|
--disable_warnings
|
|
start slave;
|
|
--enable_warnings
|
|
sync_with_master;
|
|
select * from t1 order by n;
|
|
#clean up
|
|
connection master;
|
|
drop table t1;
|
|
sync_slave_with_master;
|
|
set @@global.slave_exec_mode= default;
|