mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / engines / funcs / t / rpl_err_ignoredtable.test
blob761086232613e19bc10bd84d40d65f5771b37823
1 # Test for 
2 # Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
3 # still checks that it has the same error as on the master.
4 ##########################################################################
5 # 2006-02-07 JBM Added error code 1022 for NDB Engine + ORDER BY
6 ##########################################################################
8 -- source include/master-slave.inc
10 connection master;
11 create table t1 (a int primary key);
12 create table t4 (a int primary key);
13 # generate an error that goes to the binlog
14 --error 1022, 1062, 1582
15 insert into t1 values (1),(1);
16 insert into t4 values (1),(2);
17 save_master_pos;
18 connection slave;
19 # as the t1 table is ignored on the slave, the slave should be able to sync
20 sync_with_master;
21 # check that the table has been ignored, because otherwise the test is nonsense
22 show tables like 't1';
23 show tables like 't4';
24 SELECT * FROM test.t4 ORDER BY a;
25 connection master;
26 drop table t1;
27 save_master_pos;
28 connection slave;
29 sync_with_master;
31 # Now test that even critical errors (connection killed)
32 # are ignored if rules allow it.
33 # The "kill" idea was copied from rpl000001.test.
35 connection master1;
36 select get_lock('crash_lock%20C', 10);
38 connection master;
39 create table t2 (a int primary key);
40 insert into t2 values(1);
41 create table t3 (id int);
42 insert into t3 values(connection_id());
43 send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
45 connection master1;
46 real_sleep 2;
47 select (@id := id) - id from t3;
48 kill @id;
49 drop table t2,t3;
50 insert into t4 values (3),(4);
51 connection master;
52 --error 0,1053,2013,1317
53 reap;
54 connection master1;
55 save_master_pos;
56 connection slave;
57 sync_with_master;
58 SELECT * FROM test.t4 ORDER BY a;
60 connection master1;
61 DROP TABLE test.t4;
62 save_master_pos;
63 connection slave;
64 sync_with_master;
65 # End of 4.1 tests
66 # Adding comment for force manual merge 5.0 -> wl1012. delete me if needed