From 1108ba23e080a20686931d17298316e0dd982498 Mon Sep 17 00:00:00 2001 From: Serge Kozlov Date: Sun, 26 Oct 2008 21:53:21 +0300 Subject: [PATCH] Bug#22442. 1. Replace --sleep by wait_* primitive 2. Vertical output for SHOW SLAVE STATUS 3. Updated result file --- mysql-test/r/rpl_flush_log_loop.result | 35 ++++++++++++++++++++++++-- mysql-test/t/rpl_flush_log_loop.test | 19 +++++++++++--- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result index 3b1db804da9..271e37247d4 100644 --- a/mysql-test/r/rpl_flush_log_loop.result +++ b/mysql-test/r/rpl_flush_log_loop.result @@ -20,5 +20,36 @@ master_password='',master_port=SLAVE_PORT; start slave; flush logs; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space 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 Seconds_Behind_Master -# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 208 # # slave-bin.000001 Yes Yes 0 0 208 # None 0 No # +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port 9306 +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 98 +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table # +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 98 +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # diff --git a/mysql-test/t/rpl_flush_log_loop.test b/mysql-test/t/rpl_flush_log_loop.test index f0b368c285b..0092ec3875e 100644 --- a/mysql-test/t/rpl_flush_log_loop.test +++ b/mysql-test/t/rpl_flush_log_loop.test @@ -12,16 +12,27 @@ stop slave; eval change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=$MASTER_MYPORT; start slave; + connection master; --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; -sleep 5; +--source include/wait_for_slave_to_start.inc + +# Calculate file name of relay log after flush logs +let $relay_file= query_get_value(show slave status, Relay_Log_File,1); +let $relay_name= `select substring_index('$relay_file','.',1);`; +let $relay_index= `select substring_index('$relay_file','.',-1);`; +let $relay_index_len= `select length(substring_index('$relay_file','.',-1));`; +let $relay_index_next=`select $relay_index+1`; +let $relay_file=`select concat('$relay_name','.',repeat('0',($relay_index_len-length($relay_index_next))),$relay_index_next);`; flush logs; -sleep 5; +let $slave_param= Relay_Log_File; +let $slave_param_value= $relay_file; +source include/wait_for_slave_param.inc; --replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; +--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 # +--query_vertical show slave status # End of 4.1 tests