~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# This test checks that a slave DOES execute queries originating
 
2
# from itself, if running with --replicate-same-server-id.
 
3
 
 
4
source include/master-slave.inc;
 
5
connection slave;
 
6
create table t1 (n int);
 
7
reset master;
 
8
# replicate ourselves
 
9
stop slave;
 
10
--source include/wait_for_slave_to_stop.inc
 
11
--replace_result $SLAVE_MYPORT SLAVE_PORT
 
12
eval change master to master_port=$SLAVE_MYPORT;
 
13
start slave;
 
14
--source include/wait_for_slave_to_start.inc
 
15
insert into t1 values (1);
 
16
save_master_pos;
 
17
sync_with_master;
 
18
select * from t1; # check that indeed 2 were inserted
 
19
# We stop the slave before cleaning up otherwise we'll get
 
20
# 'drop table t1' executed twice, so an error in the slave.err
 
21
# (not critical).
 
22
stop slave;
 
23
--source include/wait_for_slave_to_stop.inc
 
24
drop table t1;
 
25
 
 
26
 
 
27
#
 
28
# Bug#38934 slave slave until does not work with --replicate-same-server-id
 
29
#
 
30
# Verifying that slave performs all events until the master_log_pos
 
31
# in presense of --replicate-same-server-id the slave is started with.
 
32
 
 
33
connection master;
 
34
reset master;
 
35
 
 
36
# setting the until position to correspond to the first following create table
 
37
# which will make the event executed and the slave sql thread stopped
 
38
# right after that.
 
39
let $until_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
 
40
inc $until_pos;
 
41
 
 
42
create table t1(n int);
 
43
create table t2(n int);
 
44
 
 
45
connection slave;
 
46
--replace_result $MASTER_MYPORT MASTER_PORT
 
47
eval change master to master_port=$MASTER_MYPORT;
 
48
--replace_result $until_pos UNTIL_POS
 
49
eval start slave until master_log_file='master-bin.000001', master_log_pos=$until_pos;
 
50
--source include/wait_for_slave_io_to_start.inc
 
51
--source include/wait_for_slave_sql_to_stop.inc
 
52
 
 
53
--echo *** checking until position execution: must be only t1 in the list ***
 
54
show tables;
 
55
 
 
56
# cleanup
 
57
 
 
58
connection slave;
 
59
start slave sql_thread;
 
60
 
 
61
connection master;
 
62
drop table t1;
 
63
drop table t2;
 
64
sync_slave_with_master;
 
65
 
 
66
# End of tests
 
67
--source include/rpl_end.inc