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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Include file to show the slave status, masking out some information
2
 
# that varies depending on where the test is executed.
3
 
 
4
 
--let $_items=$status_items
 
1
# ==== Purpose ====
 
2
#
 
3
# Show selected columns of output from SHOW SLAVE STATUS.
 
4
#
 
5
# Note: test cases should never call SHOW SLAVE STATUS directly,
 
6
# because that outputs more information to the query log than what is
 
7
# needed for the property that is being tested.  That would cause
 
8
# maintenance problems, because (1) it is hard for a human to
 
9
# understand what property is being tested; (2) the output of many of
 
10
# the fields is non-deterministic (e.g., Slave_IO_State) or changes
 
11
# frequently (e.g., binlog positions).
 
12
#
 
13
# Instead, what you want most of the time is to source one of the
 
14
# following scripts:
 
15
#
 
16
#   include/check_slave_no_error.inc
 
17
#     Assert that Slave_SQL_Errno = Slave_IO_Errno = 0.
 
18
#
 
19
#   include/check_slave_is_running.inc
 
20
#     Assert that Slave_IO_Running = Slave_SQL_Running = 'Yes'.
 
21
#
 
22
#   include/wait_for_slave_sql_error.inc
 
23
#     Wait for the SQL thread to get a given error (and assert that
 
24
#     it has this error).
 
25
#
 
26
#   include/wait_for_slave_io_error.inc
 
27
#     Wait for the IO thread to get a given error (and assert that
 
28
#     it has this error).
 
29
#
 
30
#   include/wait_for_slave_sql_to_stop.inc
 
31
#   include/wait_for_slave_io_to_stop.inc
 
32
#   include/wait_for_slave_to_stop.inc
 
33
#     Wait for the SQL thread, the IO thread, or both to stop (and
 
34
#     assert they stop).
 
35
#
 
36
# When none of the above applies, you may use this script instead.
 
37
# However, take care so that the test never contains explicit binlog
 
38
# coordinates. Usually you can read the binlog coordinates into a
 
39
# variable and compare it to some other coordinates.
 
40
#
 
41
#
 
42
# ==== Usage ====
 
43
#
 
44
# --let $status_items= Column_Name[, Column_Name[, ...]]
 
45
# --source include/show_slave_status.inc
 
46
#
 
47
# Parameters:
 
48
#   $status_items
 
49
#     Set to the name of the column in the output of SHOW SLAVE STATUS
 
50
#     that you want to display. Example:
 
51
#
 
52
#       --let $status_items= Master_SSL_Allowed
 
53
#
 
54
#     You can show multiple columns by setting $status_items to a
 
55
#     comma-separated list. Example:
 
56
#
 
57
#       --let $status_items= Master_Log_File, Relay_Master_Log_File
 
58
 
 
59
 
 
60
--let $_show_slave_status_items=$status_items
5
61
if (`SELECT "XX$status_items" = "XX"`)
6
62
{
7
 
  --die 'Variable status_items is NULL' 
 
63
  --die Bug in test case: The mysqltest variable $status_items is not set.
8
64
}
9
65
 
10
 
--disable_query_log
11
 
--vertical_results
12
66
 
13
 
while (`SELECT "XX$_items" <> "XX"`) 
 
67
while (`SELECT "XX$_show_slave_status_items" <> "XX"`) 
14
68
{
15
 
  --let $_name= `SELECT SUBSTRING_INDEX('$_items', ',', 1)`
16
 
  --let $_items= `SELECT LTRIM(SUBSTRING('$_items', LENGTH('$_name') + 2))`
17
 
 
18
 
  --let $_value= query_get_value(SHOW SLAVE STATUS, $_name, 1)
19
 
 
20
 
  --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
21
 
  --eval SELECT "$_value" AS $_name
 
69
  --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)`
 
70
  --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))`
 
71
 
 
72
  --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1)
 
73
  --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`
 
74
  --echo $_show_slave_status_name = '$_show_slave_status_value'
22
75
}
23
 
 
24
 
--horizontal_results
25
 
--enable_query_log