~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

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
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
 
11
 
 
12
connection master;
 
13
create table t1 (a int primary key);
 
14
create table t4 (a int primary key);
 
15
# generate an error that goes to the binlog
 
16
--error 1022, ER_DUP_ENTRY
 
17
insert into t1 values (1),(1);
 
18
insert into t4 values (1),(2);
 
19
# as the t1 table is ignored on the slave, the slave should be able to sync
 
20
sync_slave_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
sync_slave_with_master;
 
28
 
 
29
# Now test that even critical errors (connection killed)
 
30
# are ignored if rules allow it.
 
31
# The "kill" idea was copied from rpl000001.test.
 
32
 
 
33
connection master1;
 
34
select get_lock('crash_lock%20C', 10);
 
35
 
 
36
connection master;
 
37
create table t2 (a int primary key);
 
38
insert into t2 values(1);
 
39
create table t3 (id int);
 
40
insert into t3 values(connection_id());
 
41
send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
 
42
 
 
43
connection master1;
 
44
let $wait_condition= SELECT a > 1 FROM t2;
 
45
source include/wait_condition.inc;
 
46
select (@id := id) - id from t3;
 
47
kill @id;
 
48
drop table t2,t3;
 
49
insert into t4 values (3),(4);
 
50
connection master;
 
51
# The get_lock function causes warning for unsafe statement.
 
52
--disable_warnings
 
53
--error 0,1317,2013
 
54
reap;
 
55
--enable_warnings
 
56
connection master1;
 
57
sync_slave_with_master;
 
58
SELECT * FROM test.t4 ORDER BY a;
 
59
 
 
60
connection master1;
 
61
DROP TABLE test.t4;
 
62
sync_slave_with_master;
 
63
# End of 4.1 tests
 
64
# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed