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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
###################################
# Author: JBM
# Date: 2006-01-11
# Purpose: Second test case from
#          rpl_EE_err.test split out
#          from orginal to make the
#          first work with both RBR and SBR
###################################
#REQUIREMENT: An INSERT with a faked duplicate entry error on
#master should be replicated to slave and force the slave to stop
#(since the slave can't cause a faked error to re-occur).
###################################

-- source include/master-slave.inc

connection master;
eval create table t1 (a int, unique(a)) engine=$engine_type;
set sql_log_bin=0;
insert into t1 values(2);
set sql_log_bin=1;

--error ER_DUP_ENTRY
insert into t1 values(1),(2);
drop table t1;

connection slave;
--source include/wait_for_slave_sql_to_stop.inc
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
--echo Error: "$error" (expected different error codes on master and slave)
--echo Errno: "$errno" (expected 0)
drop table t1;

# End of 4.1 tests