File: wait_for_slave_sql_error_and_skip.inc

package info (click to toggle)
mysql-5.5 5.5.47-0%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 201,920 kB
  • ctags: 94,437
  • sloc: cpp: 646,401; ansic: 551,652; perl: 53,254; pascal: 25,099; yacc: 13,069; sh: 10,332; cs: 4,647; xml: 4,178; sql: 3,346; makefile: 1,361; lex: 639; awk: 54
file content (71 lines) | stat: -rw-r--r-- 1,710 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# ==== Purpose ====
#
# Wait for slave SQL error, skip the erroneous statement and restart
# slave
#
# ==== Usage ====
#
# --let $slave_sql_error= NUMBER
# [--let $show_sql_error= 1]
# [--let $slave_skip_counter= 1]
# [--let $not_switch_connection= 1]
# [--let $rpl_debug= 1]
# [--let $slave_timeout= NUMBER]
# --source include/wait_for_slave_sql_error_and_skip.inc
#
# Parameters:
#
#   $slave_sql_errno
#     The error number to wait for. This is required. (See
#     wait_for_slave_sql_error.inc)
#
#   $show_sql_error
#     If set, will print the error to the query log.
# 
#   $slave_skip_counter
#     If set, skip this number of events. If not set, skip one event.
#
#   $not_switch_connection
#     By default, this script executes on the connection 'slave'.  If
#     $not_switch_connection is set, this script executes on the current
#     connection.  In any case, the original connection is restored.
#
#   $slave_timeout
#     See include/wait_for_slave_param.inc
#
#   $rpl_debug
#     See include/rpl_init.inc


--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
--source include/begin_include_file.inc


if (!$rpl_debug)
{
  --disable_query_log
}


if (!$not_switch_connection)
{
  --let $rpl_connection_name= slave
  --source include/rpl_connection.inc
}


source include/wait_for_slave_sql_error.inc;


# skip the erroneous statement
if ($slave_skip_counter) {
  eval SET GLOBAL SQL_SLAVE_SKIP_COUNTER= $slave_skip_counter;
}
if (!$slave_skip_counter) {
  SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
}
source include/start_slave.inc;


--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
--source include/end_include_file.inc