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

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_row_mystery22.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
# Originally taken from rpl_mystery22.test,
 
2
# but this row-based-replication test has a totally different spirit:
 
3
# slave will not stop because of dup key,
 
4
# instead we test if it does overwrite the dup key
 
5
# as expected.
 
6
-- source include/have_binlog_format_row.inc
 
7
-- source include/master-slave.inc
 
8
 
 
9
# first, cause a duplicate key problem on the slave
 
10
create table t1(n int auto_increment primary key, s char(10));
 
11
sync_slave_with_master;
 
12
 
 
13
# bug#31552/31609 idempotency is not default any longer
 
14
# so that the declared in heading comments aim of the test
 
15
# should be backed up with explicit setting of the slave mode
 
16
set @@global.slave_exec_mode= 'IDEMPOTENT';
 
17
 
 
18
insert into t1 values (2,'old');
 
19
connection master;
 
20
insert into t1 values(NULL,'new');
 
21
insert into t1 values(NULL,'new');
 
22
save_master_pos;
 
23
connection slave;
 
24
sync_with_master;
 
25
select * from t1 order by n;
 
26
delete from t1 where n = 2;
 
27
--disable_warnings
 
28
start slave;
 
29
--enable_warnings
 
30
sync_with_master;
 
31
stop slave;
 
32
connection master;
 
33
create table t2(n int);
 
34
drop table t2;
 
35
insert into t1 values(NULL,'new');
 
36
# what happens when we delete a row which does not exist on slave?
 
37
set sql_log_bin=0;
 
38
insert into t1 values(NULL,'new');
 
39
set sql_log_bin=1;
 
40
delete from t1 where n=4;
 
41
save_master_pos;
 
42
connection slave;
 
43
--disable_warnings
 
44
start slave;
 
45
--enable_warnings
 
46
sync_with_master;
 
47
select * from t1 order by n;
 
48
#clean up
 
49
connection master;
 
50
drop table t1;
 
51
sync_slave_with_master;
 
52
set @@global.slave_exec_mode= default;