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
5
let $MYSQLD_DATADIR= `select @@datadir`;
6
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/
7
show variables like 'relay_log%';
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;
19
# Start replication slave -> master
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;
29
source include/start_slave.inc;
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.
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;
46
INSERT INTO t1 VALUE(1);
49
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
52
let $slave_param= Exec_Master_Log_Pos;
53
source include/wait_for_slave_param.inc;
56
INSERT INTO t1 VALUE(2);
57
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
61
let $slave_param= Exec_Master_Log_Pos;
62
source include/wait_for_slave_param.inc;
67
# Show status of slave
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
76
sync_slave_with_master;