~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120222223355-or06x1euyk8n0ldi
Tags: 5.1.61-0ubuntu0.10.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
* Dropped patches unnecessary with 5.1.61:
  - debian/patches/90_mysql_safer_strmov.dpatch
  - debian/patches/51_ssl_test_certs.dpatch
  - debian/patches/52_CVE-2009-4030.dpatch
  - debian/patches/53_CVE-2009-4484.dpatch
  - debian/patches/54_CVE-2008-7247.dpatch
  - debian/patches/55_CVE-2010-1621.dpatch
  - debian/patches/56_CVE-2010-1850.dpatch
  - debian/patches/57_CVE-2010-1849.dpatch
  - debian/patches/58_CVE-2010-1848.dpatch
  - debian/patches/59_CVE-2010-1626.dpatch
  - debian/patches/60_CVE-2010-2008.dpatch
  - debian/patches/60_CVE-2010-3677.dpatch
  - debian/patches/60_CVE-2010-3678.dpatch
  - debian/patches/60_CVE-2010-3679.dpatch
  - debian/patches/60_CVE-2010-3680.dpatch
  - debian/patches/60_CVE-2010-3681.dpatch
  - debian/patches/60_CVE-2010-3682.dpatch
  - debian/patches/60_CVE-2010-3683.dpatch
  - debian/patches/60_CVE-2010-3833.dpatch
  - debian/patches/60_CVE-2010-3834.dpatch
  - debian/patches/60_CVE-2010-3835.dpatch
  - debian/patches/60_CVE-2010-3836.dpatch
  - debian/patches/60_CVE-2010-3837.dpatch
  - debian/patches/60_CVE-2010-3838.dpatch
  - debian/patches/60_CVE-2010-3839.dpatch
  - debian/patches/60_CVE-2010-3840.dpatch
  - debian/patches/61_disable_longfilename_test.dpatch
  - debian/patches/62_alter_table_fix.dpatch
  - debian/patches/63_cherrypick-upstream-49479.dpatch
  - debian/patches/10_readline_build_fix.dpatch
* debian/mysql-client-5.1.docs: removed EXCEPTIONS-CLIENT file
* debian/mysql-server-5.1.docs,debian/libmysqlclient16.docs,
  debian/libmysqlclient-dev.docs: removed, no longer necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# Print status information for replication, typically used to debug
4
4
# test failures.
5
5
#
6
 
# First, the following is printed on slave:
 
6
# The following is printed on the current connection:
7
7
#
 
8
#   SELECT NOW()
8
9
#   SHOW SLAVE STATUS
 
10
#   SHOW MASTER STATUS
9
11
#   SHOW PROCESSLIST
10
12
#   SHOW BINLOG EVENTS IN <binlog_name>
11
13
#
12
14
# Where <binlog_name> is the currently active binlog.
13
15
#
14
 
# Then, the following is printed on master:
15
 
#
16
 
#   SHOW MASTER STATUS
17
 
#   SHOW PROCESSLIST
18
 
#   SHOW BINLOG EVENTS IN <sql_binlog_name>
19
 
#   SHOW BINLOG EVENTS IN <io_binlog_name>
20
 
#
21
 
# Where <sql_binlog_name> is the binlog name that the slave sql thread
22
 
# is currently reading from and <io_binlog_name> is the binlog that
23
 
# the slave IO thread is currently reading from.
 
16
# Then, the same is printed from all connections configured by
 
17
# rpl_init.inc - i.e., on connection server_N, where
 
18
# 1 <= N <= $rpl_server_count
 
19
#
24
20
#
25
21
# ==== Usage ====
26
22
#
27
 
# [let $master_connection= <connection>;]
28
 
# source include/show_rpl_debug_info.inc;
29
 
#
30
 
# If $master_connection is set, debug info will be retrieved from the
31
 
# connection named $master_connection.  Otherwise, it will be
32
 
# retrieved from the 'master' connection if the current connection is
33
 
# 'slave'.
34
 
 
35
 
let $_con= $CURRENT_CONNECTION;
36
 
--echo
37
 
--echo [on $_con]
38
 
--echo
39
 
--echo **** SHOW SLAVE STATUS on $_con ****
40
 
query_vertical SHOW SLAVE STATUS;
41
 
--echo
42
 
--echo **** SHOW PROCESSLIST on $_con ****
43
 
SHOW PROCESSLIST;
44
 
--echo
45
 
--echo **** SHOW BINLOG EVENTS on $_con ****
46
 
let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
47
 
eval SHOW BINLOG EVENTS IN '$binlog_name';
48
 
 
49
 
let $_master_con= $master_connection;
50
 
if (`SELECT '$_master_con' = ''`)
51
 
{
52
 
  if (`SELECT '$_con' = 'slave'`)
53
 
  {
54
 
    let $_master_con= master;
55
 
  }
56
 
  if (`SELECT '$_master_con' = ''`)
57
 
  {
58
 
    --echo Unable to determine master connection. No debug info printed for master.
59
 
    --echo Please fix the test case by setting $master_connection before sourcing
60
 
    --echo show_rpl_debug_info.inc.
61
 
  }
62
 
}
63
 
 
64
 
if (`SELECT '$_master_con' != ''`)
65
 
{
66
 
 
67
 
  let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
68
 
  let $master_binlog_name_sql= query_get_value("SHOW SLAVE STATUS", Relay_Master_Log_File, 1);
69
 
  --echo
70
 
  --echo [on $_master_con]
71
 
  connection $_master_con;
72
 
  --echo
73
 
  --echo **** SHOW MASTER STATUS on $_master_con ****
 
23
# [--let $rpl_only_current_connection= 1]
 
24
# --source include/show_rpl_debug_info.inc
 
25
#
 
26
# Parameters:
 
27
#   $rpl_only_current_connection
 
28
#     By default, debug info is printed from all connections, starting
 
29
#     with the current connection. If this variable is set, debug
 
30
#     info is printed only for the current connection.
 
31
#     
 
32
#
 
33
# ==== Side effects ====
 
34
#
 
35
# Turns on enable_query_log, enable_result_log, enable_warnings,
 
36
# horizontal_results, and enable_abort_on_error.
 
37
#
 
38
# Prints non-deterministic output to the query log.  This file should
 
39
# never be called in a test that does not fail.
 
40
 
 
41
 
 
42
--enable_query_log
 
43
--enable_result_log
 
44
--enable_warnings
 
45
--disable_abort_on_error
 
46
--horizontal_results
 
47
 
 
48
 
 
49
--let $_rpl_old_con= $CURRENT_CONNECTION
 
50
--let $_rpl_is_first_server= 1
 
51
--let $_rpl_server= $rpl_server_count
 
52
--inc $_rpl_server
 
53
 
 
54
 
 
55
while ($_rpl_server)
 
56
{
 
57
  if (!$_rpl_is_first_server)
 
58
  {
 
59
    --connection server_$_rpl_server
 
60
  }
 
61
 
 
62
  --echo
 
63
  --echo ############################## $CURRENT_CONNECTION ##############################
 
64
  --echo
 
65
  --echo **** SHOW WARNINGS on $CURRENT_CONNECTION ****
 
66
  SHOW WARNINGS;
 
67
  --echo
 
68
  --echo **** SELECT replication-related variables on $CURRENT_CONNECTION ****
 
69
  SELECT NOW(), @@SERVER_ID;
 
70
  --echo
 
71
  --echo **** SHOW SLAVE STATUS on $CURRENT_CONNECTION ****
 
72
  query_vertical SHOW SLAVE STATUS;
 
73
  --echo
 
74
  --echo **** SHOW MASTER STATUS on $CURRENT_CONNECTION ****
74
75
  query_vertical SHOW MASTER STATUS;
75
76
  --echo
76
 
  --echo **** SHOW PROCESSLIST on $_master_con ****
 
77
  --echo **** SHOW SLAVE HOSTS on $CURRENT_CONNECTION ****
 
78
  query_vertical SHOW SLAVE HOSTS;
 
79
  --echo
 
80
  --echo **** SHOW PROCESSLIST on $CURRENT_CONNECTION ****
77
81
  SHOW PROCESSLIST;
78
82
  --echo
79
 
  --echo **** SHOW BINLOG EVENTS on $_master_con ****
80
 
  eval SHOW BINLOG EVENTS IN '$master_binlog_name_sql';
81
 
  if (`SELECT '$master_binlog_name_io' != '$master_binlog_name_sql'`)
 
83
  --echo **** SHOW BINARY LOGS on $CURRENT_CONNECTION ****
 
84
  SHOW BINARY LOGS;
 
85
  --echo
 
86
  --echo **** SHOW BINLOG EVENTS on $CURRENT_CONNECTION ****
 
87
  let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
 
88
  --echo binlog_name = '$binlog_name'
 
89
  eval SHOW BINLOG EVENTS IN '$binlog_name';
 
90
 
 
91
 
 
92
  --let $_rpl_is_first_server= 0
 
93
  --dec $_rpl_server
 
94
  # Don't use same connection twice.
 
95
  if (`SELECT 'server_$_rpl_server' = '$_rpl_old_con'`)
82
96
  {
83
 
    eval SHOW BINLOG EVENTS IN '$master_binlog_name_io';
 
97
    --dec $_rpl_server
 
98
    if ($rpl_only_current_connection)
 
99
    {
 
100
      --let $_rpl_server= 0
 
101
    }
84
102
  }
85
 
 
86
 
  connection $_con;
87
103
}
 
104
 
 
105
--connection $_rpl_old_con
 
106
--enable_abort_on_error