mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for
BUG#797 "If query ignored on slave (replicate-ignore-table) the slave still checks if the returned error (0) is the same as the one on the master, whereas it shouldn't test this. Plus a new test for BUG#797.
This commit is contained in:
15
mysql-test/r/rpl_error_ignored_table.result
Normal file
15
mysql-test/r/rpl_error_ignored_table.result
Normal file
@ -0,0 +1,15 @@
|
||||
slave stop;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
slave start;
|
||||
create table t1 (a int primary key);
|
||||
insert into t1 values (1),(1);
|
||||
Duplicate entry '1' for key 1
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root 9306 1 master-bin.001 213 slave-relay-bin.002 254 master-bin.001 Yes Yes 0 0 213 254
|
||||
show tables like 't1';
|
||||
Tables_in_test (t1)
|
||||
drop table t1;
|
1
mysql-test/t/rpl_error_ignored_table-slave.opt
Normal file
1
mysql-test/t/rpl_error_ignored_table-slave.opt
Normal file
@ -0,0 +1 @@
|
||||
--replicate-ignore-table=test.t1
|
22
mysql-test/t/rpl_error_ignored_table.test
Normal file
22
mysql-test/t/rpl_error_ignored_table.test
Normal file
@ -0,0 +1,22 @@
|
||||
# Test for
|
||||
# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
|
||||
# still checks that it has the same error as on the master.
|
||||
|
||||
source include/master-slave.inc;
|
||||
connection master;
|
||||
create table t1 (a int primary key);
|
||||
# generate an error that goes to the binlog
|
||||
--error 1062;
|
||||
insert into t1 values (1),(1);
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# as the t1 table is ignored on the slave, the slave should be able to sync
|
||||
sync_with_master;
|
||||
show slave status;
|
||||
# check that the table has been ignored, because otherwise the test is nonsense
|
||||
show tables like 't1';
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
Reference in New Issue
Block a user