1# ==== Purpose ====
2#
3# Waits until the IO thread of the current connection has started and
4# connected to the master (i.e., until SHOW SLAVE STATUS returns Yes
5# in the Slave_IO_Running field), or until a timeout is reached.
6#
7#
8# ==== Usage ====
9#
10# [--let $slave_timeout= NUMBER]
11# [--let $rpl_debug= 1]
12# [--let $rpl_allow_error= 1]
13# --source include/wait_for_slave_io_to_start.inc
14#
15# Parameters:
16#   $slave_timeout
17#     See include/wait_for_slave_param.inc
18#
19#   $rpl_allow_error
20#     By default, this file fails if there is an error in the IO
21#     thread.  However, the IO thread can recover and reconnect after
22#     certain errors.  If such an error is expected, can set
23#     $rpl_allow_error=1.  This will prevent this file from failing if
24#     there is an error in the IO thread.
25#
26#   $rpl_debug
27#     See include/rpl_init.inc
28
29
30--let $include_filename= wait_for_slave_io_to_start.inc
31--source include/begin_include_file.inc
32
33
34let $slave_param= Slave_IO_Running;
35let $slave_param_value= Yes;
36if (!$rpl_allow_error)
37{
38  --let $slave_error_param= Last_IO_Errno
39}
40source include/wait_for_slave_param.inc;
41--let $slave_error_param=
42--let $rpl_allow_error= 0
43
44
45--let $include_filename= wait_for_slave_io_to_start.inc
46--source include/end_include_file.inc
47