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

« back to all changes in this revision

Viewing changes to mysql-test/include/rpl_end.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
# ==== Purpose ====
 
2
#
 
3
# Shut down replication initialized by include/rpl_init.inc.
 
4
#
 
5
# This syncs all servers, executes STOP SLAVE on all servers, executes
 
6
# CHANGE MASTER on all servers, and disconnects all connections
 
7
# configured by rpl_init.inc.
 
8
#
 
9
# It does not execute RESET MASTER or RESET SLAVE, because that would
 
10
# remove binlogs which are possibly useful debug information in case
 
11
# the test case later fails with a result mismatch.  If you need that,
 
12
# source include/rpl_reset.inc before you source this file.
 
13
#
 
14
#
 
15
# ==== Usage ====
 
16
#
 
17
# [--let $rpl_only_running_threads= 1]
 
18
# [--let $rpl_debug= 1]
 
19
# --source include/rpl_end.inc
 
20
#
 
21
# Parameters:
 
22
#   $rpl_only_running_threads
 
23
#     If one or both of the IO and SQL threads is stopped, sync and
 
24
#     stop only the threads that are running.  See
 
25
#     include/rpl_sync.inc and include/stop_slave.inc for details.
 
26
#
 
27
#   $rpl_debug
 
28
#     See include/rpl_init.inc
 
29
#
 
30
# Note:
 
31
#   This script will fail if Last_SQL_Error or Last_IO_Error is
 
32
#   nonempty.  If you expect an error in the SQL thread, you should
 
33
#   normally call this script as follows:
 
34
#
 
35
#     --source include/wait_for_slave_sql_error.inc
 
36
#     --source include/stop_slave_io.inc
 
37
#     RESET SLAVE;
 
38
#     --let $rpl_only_running_threads= 1
 
39
#     --source include/rpl_end.inc
 
40
#
 
41
#
 
42
# ==== Side effects ====
 
43
#
 
44
# Changes the current connection to 'default'.
 
45
 
 
46
 
 
47
--let $include_filename= rpl_end.inc
 
48
--source include/begin_include_file.inc
 
49
 
 
50
 
 
51
if (!$rpl_inited)
 
52
{
 
53
  --die ERROR IN TEST: rpl_end.inc was sourced when replication was not configured. Most likely, rpl_end.inc was sourced twice or rpl_init.inc has not been sourced.
 
54
}
 
55
 
 
56
 
 
57
if ($rpl_debug)
 
58
{
 
59
  --echo ---- Check that no slave thread has an error ----
 
60
}
 
61
 
 
62
--let $_rpl_server= $rpl_server_count
 
63
while ($_rpl_server)
 
64
{
 
65
  --let $rpl_connection_name= server_$_rpl_server
 
66
  --source include/rpl_connection.inc
 
67
 
 
68
  # Only check slave threads for error on hosts that were at some
 
69
  # point configured as slave.
 
70
  --let $_tmp= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
 
71
  if (`SELECT '$_tmp' != 'No such row'`)
 
72
  {
 
73
    --source include/check_slave_no_error.inc
 
74
  }
 
75
 
 
76
  --dec $_rpl_server
 
77
}
 
78
 
 
79
--source include/rpl_sync.inc
 
80
--source include/rpl_stop_slaves.inc
 
81
 
 
82
# mtr configures server 2 to be a slave before it runs the test. We
 
83
# have to restore that state now, so we change topology to 1->2.
 
84
--let $rpl_topology= 1->2
 
85
--source include/rpl_change_topology.inc
 
86
 
 
87
 
 
88
--connection default
 
89
--let $_rpl_server= $rpl_server_count
 
90
--let $_rpl_one= _1
 
91
while ($_rpl_server)
 
92
{
 
93
  --disconnect server_$_rpl_server
 
94
  --disconnect server_$_rpl_server$_rpl_one
 
95
  --dec $_rpl_server
 
96
}
 
97
 
 
98
--let $rpl_inited= 0
 
99
 
 
100
# Do not restore connection, because we have disconnected it.
 
101
--let $skip_restore_connection= 1
 
102
--let $include_filename= rpl_end.inc
 
103
--source include/end_include_file.inc