summaryrefslogtreecommitdiff
path: root/mysql-test/include/wait_for_slave_sql_error_and_skip.inc
blob: 11c02c0b490e6d4f5b35d150623e13df0d598f49 (plain)
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
# ==== Purpose ====
#
# Wait for slave SQL error, skip the erroneous statement and restart
# slave
#
# ==== Usage ====
#
# let $slave_sql_error= <ERRNO>;
# 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_timeout
#   See wait_for_slave_param.inc for description.
# 
# $master_connection
#   See wait_for_slave_param.inc for description.
#
# $slave_skip_counter
#   If set, skip this number of events. If not set, skip one event.
#
# $not_switch_connection If set, don't switch to slave and don't switch back
# master.
#

echo --source include/wait_for_slave_sql_error_and_skip.inc;
if (!$not_switch_connection)
{
  connection slave;
}
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;
if (!$not_switch_connection)
{
  connection master;
}