~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ==== Purpose ====
 
2
#
 
3
# Wait for slave SQL error, skip the erroneous statement and restart
 
4
# slave
 
5
#
 
6
# ==== Usage ====
 
7
#
 
8
# --let $slave_sql_error= NUMBER
 
9
# [--let $show_sql_error= 1]
 
10
# [--let $slave_skip_counter= 1]
 
11
# [--let $not_switch_connection= 1]
 
12
# [--let $rpl_debug= 1]
 
13
# [--let $slave_timeout= NUMBER]
 
14
# --source include/wait_for_slave_sql_error_and_skip.inc
 
15
#
 
16
# Parameters:
 
17
#
 
18
#   $slave_sql_errno
 
19
#     The error number to wait for. This is required. (See
 
20
#     wait_for_slave_sql_error.inc)
 
21
#
 
22
#   $show_sql_error
 
23
#     If set, will print the error to the query log.
 
24
 
25
#   $slave_skip_counter
 
26
#     If set, skip this number of events. If not set, skip one event.
 
27
#
 
28
#   $not_switch_connection
 
29
#     By default, this script executes on the connection 'slave'.  If
 
30
#     $not_switch_connection is set, this script executes on the current
 
31
#     connection.  In any case, the original connection is restored.
 
32
#
 
33
#   $slave_timeout
 
34
#     See include/wait_for_slave_param.inc
 
35
#
 
36
#   $rpl_debug
 
37
#     See include/rpl_init.inc
 
38
 
 
39
 
 
40
--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
 
41
--source include/begin_include_file.inc
 
42
 
 
43
 
 
44
if (!$rpl_debug)
 
45
{
 
46
  --disable_query_log
 
47
}
 
48
 
 
49
 
 
50
if (!$not_switch_connection)
 
51
{
 
52
  --let $rpl_connection_name= slave
 
53
  --source include/rpl_connection.inc
 
54
}
 
55
 
 
56
 
 
57
source include/wait_for_slave_sql_error.inc;
 
58
 
 
59
 
 
60
# skip the erroneous statement
 
61
if ($slave_skip_counter) {
 
62
  eval SET GLOBAL SQL_SLAVE_SKIP_COUNTER= $slave_skip_counter;
 
63
}
 
64
if (!$slave_skip_counter) {
 
65
  SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 
66
}
 
67
source include/start_slave.inc;
 
68
 
 
69
 
 
70
--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
 
71
--source include/end_include_file.inc