summaryrefslogtreecommitdiff
path: root/mysql-test/include/wait_for_slave_io_to_stop.inc
blob: f61b0db1ed7a9e4f6f59652730681720ae79960b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# ==== Purpose ====
#
# Waits until the IO thread of the current connection has stopped, or
# until a timeout is reached.
#
# ==== Usage ====
#
# source include/wait_for_slave_io_to_stop.inc;
#
# Parameters to this macro are $slave_timeout and
# $master_connection. See wait_for_slave_param.inc for
# descriptions.

# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE
# STATUS will return an empty set.
let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
if (`SELECT '$_slave_io_running' != 'No such row'`)
{
  let $slave_param= Slave_IO_Running;
  let $slave_param_value= No;
  let $slave_error_message= Failed while waiting for slave IO thread to stop;
  source include/wait_for_slave_param.inc;
  let $slave_error_message= ;
}