mariadb/mysql-test/suite/rpl/t/rpl_skip_error.test

83 lines
2.1 KiB
Text
Raw Normal View History

# ==== Purpose ====
#
# Verify that --slave-skip-errors works correctly. The error messages
# specified by --slave-skip-errors on slave should be ignored. If
# such errors occur, they should not be reported and not cause the
# slave to stop.
#
# ==== Method ====
#
# We run the slave with --slave-skip-errors=1062 (the code for
# duplicate key). On slave, we insert value 1 in a table, and then,
# on master, we insert value 1 in the table. The error should be
# ignored on slave.
#
# ==== Related bugs ====
#
# BUG#28839: Errors in strict mode silently stop SQL thread if --slave-skip-errors exists
# bug in this test: BUG#30594: rpl.rpl_skip_error is nondeterministic
source include/master-slave.inc;
2008-03-14 17:52:57 +01:00
source include/have_binlog_format_statement.inc;
--echo ==== Test Without sql_mode=strict_trans_tables ====
--echo [on master]
create table t1 (n int not null primary key);
--echo [on slave]
sync_slave_with_master;
insert into t1 values (1);
--echo [on master]
connection master;
# Here we expect (ignored) error, since 1 is already in slave table
insert into t1 values (1);
# These should work fine
insert into t1 values (2),(3);
2008-03-14 17:52:57 +01:00
sync_slave_with_master;
--echo [on slave]
select * from t1 order by n;
--echo ==== Test With sql_mode=strict_trans_tables ====
insert into t1 values (7),(8);
--echo [on master]
connection master;
set sql_mode=strict_trans_tables;
insert into t1 values (7), (8), (9);
--echo [on slave]
sync_slave_with_master;
select * from t1 order by n;
source include/show_slave_status2.inc;
2008-03-14 17:52:57 +01:00
--echo ==== Clean Up ====
connection master;
drop table t1;
sync_slave_with_master;
# End of 4.1 tests
#
# #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists
#
2007-06-21 11:48:01 +05:00
connection master;
create table t1(a int primary key);
insert into t1 values (1),(2);
delete from t1 where @@server_id=1;
set sql_mode=strict_trans_tables;
insert into t1 values (7), (8), (9);
--echo [on slave]
sync_slave_with_master;
select * from t1;
source include/show_slave_status2.inc;
--echo ==== Clean Up ====
connection master;
drop table t1;
sync_slave_with_master;
# End of 5.0 tests