~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_err_ignoredtable.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
##########################################################################
 
7
 
 
8
-- source include/master-slave.inc
 
9
 
 
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, ER_DUP_ENTRY
 
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;
 
30
 
 
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.
 
34
 
 
35
connection master1;
 
36
select get_lock('crash_lock%20C', 10);
 
37
 
 
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);
 
44
 
 
45
connection master1;
 
46
let $wait_condition= SELECT a > 1 FROM t2;
 
47
source include/wait_condition.inc;
 
48
select (@id := id) - id from t3;
 
49
kill @id;
 
50
drop table t2,t3;
 
51
insert into t4 values (3),(4);
 
52
connection master;
 
53
--error 0,1053,2013,1048
 
54
reap;
 
55
connection master1;
 
56
save_master_pos;
 
57
connection slave;
 
58
sync_with_master;
 
59
SELECT * FROM test.t4 ORDER BY a;
 
60
 
 
61
connection master1;
 
62
DROP TABLE test.t4;
 
63
save_master_pos;
 
64
connection slave;
 
65
sync_with_master;
 
66
# End of 4.1 tests
 
67
# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed