# Testing if "flush logs" command bouncing resulting in logs created in a loop 
# in case of bi-directional replication
-- source include/master-slave.inc

#
#  Start replication master -> slave 
#
connection slave;
--disable_warnings
stop slave;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root',
 master_password='',master_port=$MASTER_MYPORT;
start slave;

#
#  Start replication slave -> master
#
connection master;
--disable_warnings
stop slave;
--enable_warnings
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root',
 master_password='',master_port=$SLAVE_MYPORT;
start slave;

#
#  Wait for start of slave IO and SQL threads
#
let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%';
-- source $MYSQL_TEST_DIR/suite/engines/funcs/t/wait_slave_status.inc

#
#  Flush logs of slave
#
flush logs;
sleep 5;

#
#  Show status of slave
#
--vertical_results
#checking show slave status
let $status_items= Master_Host,Master_User,Connect_Retry,Master_Log_File,Read_Master_Log_Pos,Relay_Master_Log_File,Slave_IO_Running,Slave_SQL_Running,Replicate_Do_DB,Replicate_Ignore_DB,Replicate_Do_Table,Replicate_Wild_Do_Table,Replicate_Wild_Ignore_Table,Last_Errno,Last_Error,Skip_Counter,Exec_Master_Log_Pos,Until_Condition,Until_Log_File,Until_Log_Pos,Master_SSL_Allowed,Master_SSL_CA_File,Master_SSL_CA_Path,Master_SSL_Cert,Master_SSL_Cipher,Master_SSL_Key,Master_SSL_Verify_Server_Cert,Last_IO_Errno,Last_IO_Error,Last_SQL_Errno,Last_SQL_Error,Replicate_Ignore_Server_Ids,Master_Server_Id;
source include/show_slave_status.inc;
STOP SLAVE;
