2003-07-08 15:50:57 +02:00
|
|
|
# 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.
|
2006-02-07 14:51:46 +01:00
|
|
|
##########################################################################
|
|
|
|
# 2006-02-07 JBM Added error code 1022 for NDB Engine + ORDER BY
|
|
|
|
##########################################################################
|
2003-07-08 15:50:57 +02:00
|
|
|
|
2005-12-22 06:39:02 +01:00
|
|
|
-- source include/master-slave.inc
|
|
|
|
|
2003-07-08 15:50:57 +02:00
|
|
|
connection master;
|
|
|
|
create table t1 (a int primary key);
|
2005-12-23 14:45:02 +01:00
|
|
|
create table t4 (a int primary key);
|
2003-07-08 15:50:57 +02:00
|
|
|
# generate an error that goes to the binlog
|
2007-01-22 18:42:52 +02:00
|
|
|
--error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
|
2003-07-08 15:50:57 +02:00
|
|
|
insert into t1 values (1),(1);
|
2005-12-23 14:45:02 +01:00
|
|
|
insert into t4 values (1),(2);
|
2003-07-08 15:50:57 +02:00
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
# as the t1 table is ignored on the slave, the slave should be able to sync
|
|
|
|
sync_with_master;
|
|
|
|
# check that the table has been ignored, because otherwise the test is nonsense
|
|
|
|
show tables like 't1';
|
2005-12-23 14:45:02 +01:00
|
|
|
show tables like 't4';
|
2006-02-07 14:51:46 +01:00
|
|
|
SELECT * FROM test.t4 ORDER BY a;
|
2003-07-08 15:50:57 +02:00
|
|
|
connection master;
|
|
|
|
drop table t1;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
2004-03-11 17:38:19 +01:00
|
|
|
|
|
|
|
# Now test that even critical errors (connection killed)
|
|
|
|
# are ignored if rules allow it.
|
|
|
|
# The "kill" idea was copied from rpl000001.test.
|
|
|
|
|
|
|
|
connection master1;
|
|
|
|
select get_lock('crash_lock%20C', 10);
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
create table t2 (a int primary key);
|
|
|
|
insert into t2 values(1);
|
|
|
|
create table t3 (id int);
|
|
|
|
insert into t3 values(connection_id());
|
|
|
|
send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
|
|
|
|
|
|
|
|
connection master1;
|
2004-04-28 23:43:46 +02:00
|
|
|
real_sleep 2;
|
2004-03-11 17:38:19 +01:00
|
|
|
select (@id := id) - id from t3;
|
|
|
|
kill @id;
|
|
|
|
drop table t2,t3;
|
2005-12-23 14:45:02 +01:00
|
|
|
insert into t4 values (3),(4);
|
2004-03-11 17:38:19 +01:00
|
|
|
connection master;
|
2005-12-14 21:42:08 +04:00
|
|
|
--error 0,1053,2013
|
2004-03-11 17:38:19 +01:00
|
|
|
reap;
|
|
|
|
connection master1;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
2006-02-07 14:51:46 +01:00
|
|
|
SELECT * FROM test.t4 ORDER BY a;
|
2005-07-28 03:22:47 +03:00
|
|
|
|
2005-12-23 14:45:02 +01:00
|
|
|
connection master1;
|
|
|
|
DROP TABLE test.t4;
|
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
|
|
|
sync_with_master;
|
2005-07-28 03:22:47 +03:00
|
|
|
# End of 4.1 tests
|
2005-09-12 22:47:15 +02:00
|
|
|
# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed
|