~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-21 15:31:05 UTC
  • mfrom: (1.1.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20100621153105-pbbz3t6nyrf9t2zq
Tags: upstream-5.1.48
ImportĀ upstreamĀ versionĀ 5.1.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# ==== Purpose ====
2
2
#
3
3
# Waits until the IO thread of the current connection has got an
4
 
# error, or until a timeout is reached.
 
4
# error, or until a timeout is reached. Also waits until the IO
 
5
# thread has completely stopped.
5
6
#
6
7
# ==== Usage ====
7
8
#
8
 
# source include/wait_for_slave_io_error.inc;
9
 
#
10
 
# Parameters to this macro are $slave_timeout and
11
 
# $slave_keep_connection. See wait_for_slave_param.inc for
12
 
# descriptions.
 
9
# # Wait several errors.  
 
10
# let $slave_io_errno= 1, 2, 3; 
 
11
# source include/wait_for_slave_io_error.inc;
 
12
#
 
13
# # Print error message 
 
14
# let $slave_io_errno= 1; 
 
15
# let $show_slave_io_error= 1; 
 
16
# source include/wait_for_slave_io_error.inc;
 
17
#
 
18
# Parameters:
 
19
#
 
20
# $slave_io_errno
 
21
#   The expected IO error numbers.  This is required.
 
22
#   (After BUG#41956 has been fixed, this will be required to be a
 
23
#   symbolic name instead of a numbers.)
 
24
#
 
25
# $show_slave_io_error
 
26
#   If set, will print the error to the query log.
 
27
 
28
# $slave_timeout
 
29
#   See wait_for_slave_param.inc for description.
 
30
 
31
# $master_connection
 
32
#   See wait_for_slave_param.inc for description.
 
33
 
 
34
if (`SELECT '$slave_io_errno' = ''`) {
 
35
  --die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc
 
36
}
13
37
 
14
38
let $old_slave_param_comparison= $slave_param_comparison;
15
 
 
16
39
let $slave_param= Last_IO_Errno;
17
40
let $slave_param_comparison= !=;
18
41
let $slave_param_value= 0;
19
42
let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
20
43
source include/wait_for_slave_param.inc;
21
44
let $slave_error_message= ;
22
 
 
23
45
let $slave_param_comparison= $old_slave_param_comparison;
 
46
 
 
47
let $_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
 
48
if (`SELECT $_error NOT IN ($slave_io_errno)`) {
 
49
  --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) ****
 
50
  source include/show_rpl_debug_info.inc;
 
51
  --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) ****
 
52
  --die Slave stopped with wrong error code
 
53
}
 
54
 
 
55
if ($show_slave_io_error)
 
56
{
 
57
  let $error= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1);
 
58
  echo Last_IO_Error = $error;
 
59
}