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

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_flushlog_loop.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
# Testing if "flush logs" command bouncing resulting in logs created in a loop 
 
2
# in case of bi-directional replication
 
3
-- source include/master-slave.inc
 
4
 
 
5
let $MYSQLD_DATADIR= `select @@datadir`;
 
6
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/
 
7
show variables like 'relay_log%';
 
8
 
 
9
connection slave;
 
10
--disable_warnings
 
11
stop slave;
 
12
--enable_warnings
 
13
--replace_result $MASTER_MYPORT MASTER_PORT
 
14
eval change master to master_host='127.0.0.1',master_user='root',
 
15
 master_password='',master_port=$MASTER_MYPORT;
 
16
start slave;
 
17
 
 
18
#
 
19
#  Start replication slave -> master
 
20
#
 
21
connection master;
 
22
--disable_warnings
 
23
stop slave;
 
24
--enable_warnings
 
25
--replace_result $SLAVE_MYPORT SLAVE_PORT
 
26
eval change master to master_host='127.0.0.1',master_user='root',
 
27
 master_password='',master_port=$SLAVE_MYPORT;
 
28
 
 
29
source include/start_slave.inc;
 
30
 
 
31
#
 
32
#  Flush logs of slave
 
33
#
 
34
# Create full loop by following way:
 
35
# 1. Insert into t1 on master (1st).
 
36
# 2. Insert into t1 on slave (2nd) when the event (1st) for t1 replicated.
 
37
# 3. Master waits until the event (2nd) for t1 will be replicated.
 
38
 
 
39
--disable_query_log
 
40
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
 
41
let $wait_binlog_event= CREATE TABLE t1;
 
42
--source include/wait_for_binlog_event.inc
 
43
sync_slave_with_master;
 
44
 
 
45
connection master;
 
46
INSERT INTO t1 VALUE(1);
 
47
--enable_query_log
 
48
FLUSH LOGS;
 
49
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
 
50
 
 
51
connection slave;
 
52
let $slave_param= Exec_Master_Log_Pos;
 
53
source include/wait_for_slave_param.inc;
 
54
 
 
55
--disable_query_log
 
56
INSERT INTO t1 VALUE(2);
 
57
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
 
58
--enable_query_log
 
59
 
 
60
connection master;
 
61
let $slave_param= Exec_Master_Log_Pos;
 
62
source include/wait_for_slave_param.inc;
 
63
 
 
64
--enable_query_log
 
65
 
 
66
#
 
67
#  Show status of slave
 
68
#
 
69
--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION
 
70
--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
 
71
--query_vertical SHOW SLAVE STATUS
 
72
 
 
73
--disable_query_log
 
74
connection master;
 
75
DROP TABLE t1;
 
76
sync_slave_with_master;
 
77
--enable_query_log