~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysql-test/include/wait_for_slave_to_stop.inc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# ==== Purpose ====
2
2
#
3
3
# Waits until both the IO and SQL threads of the current connection
4
 
# have stopped, or until a timeout is reached.
 
4
# have stopped gracefully.
 
5
#
 
6
# Note: this script will fail if one of the threads stops with an
 
7
# error.  If you expect an error in one of the threads, use
 
8
# include/wait_for_slave_io_error.inc or
 
9
# include/wait_for_slave_sql_error.inc instead.
 
10
#
 
11
# This script also fails if a timeout is reached (default 300
 
12
# seconds).
 
13
#
5
14
#
6
15
# ==== Usage ====
7
16
#
8
 
# source include/wait_for_slave_to_stop.inc;
9
 
#
10
 
# Parameters to this macro are $slave_timeout and
11
 
# $master_connection. See wait_for_slave_param.inc for
12
 
# descriptions.
13
 
 
14
 
# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE
15
 
# STATUS will return an empty set.
16
 
let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
17
 
if (`SELECT '$_slave_io_running' != 'No such row'`)
18
 
{
19
 
  let $slave_error_message= Failed while waiting for slave to stop;
20
 
 
21
 
  let $slave_param= Slave_IO_Running;
22
 
  let $slave_param_value= No;
23
 
  source include/wait_for_slave_param.inc;
24
 
 
25
 
  let $slave_param= Slave_SQL_Running;
26
 
  let $slave_param_value= No;
27
 
  source include/wait_for_slave_param.inc;
28
 
 
29
 
  let $slave_error_message= ;
30
 
}
 
17
# [--let $slave_timeout= NUMBER]
 
18
# [--let $rpl_debug= 1]
 
19
# --source include/wait_for_slave_to_stop.inc
 
20
#
 
21
# Parameters:
 
22
#   $slave_timeout
 
23
#     See include/wait_for_slave_param.inc
 
24
#
 
25
#   $rpl_debug
 
26
#     See include/rpl_init.inc
 
27
 
 
28
 
 
29
--let $include_filename= wait_for_slave_to_stop.inc
 
30
--source include/begin_include_file.inc
 
31
 
 
32
 
 
33
--source include/wait_for_slave_sql_to_stop.inc
 
34
--source include/wait_for_slave_io_to_stop.inc
 
35
 
 
36
 
 
37
--let $include_filename= wait_for_slave_to_stop.inc
 
38
--source include/end_include_file.inc