~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/suite/engines/funcs/t/rpl_row_until.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/not_ndb_default.inc
 
2
-- source include/have_binlog_format_row.inc
 
3
-- source include/master-slave.inc
 
4
 
 
5
# Test is dependent on binlog positions
 
6
 
 
7
# prepare version for substitutions
 
8
let $VERSION=`select version()`;
 
9
 
 
10
# stop slave before he will start replication also sync with master
 
11
# for avoiding undetermenistic behaviour
 
12
save_master_pos;
 
13
connection slave;
 
14
sync_with_master;
 
15
stop slave;
 
16
 
 
17
connection master;
 
18
# create some events on master
 
19
create table t1(n int not null auto_increment primary key);
 
20
insert into t1 values (1),(2),(3),(4);
 
21
drop table t1;
 
22
create table t2(n int not null auto_increment primary key);
 
23
insert into t2 values (1),(2);
 
24
insert into t2 values (3),(4);
 
25
drop table t2;
 
26
 
 
27
# try to replicate all queries until drop of t1
 
28
connection slave;
 
29
start slave until master_log_file='master-bin.000001', master_log_pos=311;
 
30
sleep 2;
 
31
wait_for_slave_to_stop;
 
32
# here table should be still not deleted
 
33
select * from t1;
 
34
--vertical_results
 
35
--replace_result $MASTER_MYPORT MASTER_MYPORT
 
36
--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
 
37
show slave status;
 
38
 
 
39
# this should fail right after start
 
40
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
 
41
# again this table should be still not deleted
 
42
select * from t1;
 
43
sleep 2;
 
44
wait_for_slave_to_stop;
 
45
--vertical_results
 
46
--replace_result $MASTER_MYPORT MASTER_MYPORT
 
47
--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
 
48
show slave status;
 
49
 
 
50
# try replicate all up to and not including the second insert to t2;
 
51
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
 
52
sleep 2;
 
53
wait_for_slave_to_stop;
 
54
select * from t2;
 
55
--vertical_results
 
56
--replace_result $MASTER_MYPORT MASTER_MYPORT
 
57
--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
 
58
show slave status;
 
59
 
 
60
# clean up
 
61
start slave;
 
62
connection master;
 
63
save_master_pos;
 
64
connection slave;
 
65
sync_with_master;
 
66
stop slave;
 
67
 
 
68
# this should stop immediately as we are already there
 
69
start slave until master_log_file='master-bin.000001', master_log_pos=740;
 
70
sleep 2;
 
71
wait_for_slave_to_stop;
 
72
# here the sql slave thread should be stopped
 
73
--vertical_results
 
74
--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
 
75
--replace_column 1 # 7 # 9 # 22 # 23 # 33 #
 
76
show slave status;
 
77
 
 
78
#testing various error conditions
 
79
--error 1277
 
80
start slave until master_log_file='master-bin', master_log_pos=561;
 
81
--error 1277
 
82
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
 
83
--error 1277
 
84
start slave until master_log_file='master-bin.000001';
 
85
--error 1277
 
86
start slave until relay_log_file='slave-relay-bin.000002';
 
87
--error 1277
 
88
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
 
89
# Warning should be given for second command
 
90
start slave sql_thread;
 
91
start slave until master_log_file='master-bin.000001', master_log_pos=740;