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

« back to all changes in this revision

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