1
by brian
clean slate |
1 |
# include/wait_for_slave_param.inc |
2 |
#
|
|
3 |
# SUMMARY |
|
4 |
#
|
|
5 |
# Waits until SHOW SLAVE STATUS has returned a spicified value. |
|
6 |
#
|
|
7 |
# USAGE |
|
8 |
#
|
|
9 |
# let $slave_param= Slave_SQL_Running; |
|
10 |
# let $slave_param_value= No; |
|
11 |
# --source include/slave_wait_param.inc |
|
12 |
||
13 |
let $slave_wait_param_counter= 300; |
|
14 |
let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1); |
|
15 |
while (`select "$slave_value" != "$slave_param_value"`) |
|
16 |
{
|
|
17 |
dec $slave_wait_param_counter; |
|
18 |
if (!$slave_wait_param_counter) |
|
19 |
{
|
|
20 |
--echo ERROR: failed while waiting for slave parameter $slave_param: $slave_param_value |
|
21 |
query_vertical show slave status; |
|
22 |
exit; |
|
23 |
}
|
|
24 |
sleep 0.1; |
|
25 |
let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1); |
|
26 |
}
|