~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-21 15:31:05 UTC
  • mfrom: (1.1.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20100621153105-pbbz3t6nyrf9t2zq
Tags: upstream-5.1.48
ImportĀ upstreamĀ versionĀ 5.1.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
23
23
# $master_connection
24
24
#   See wait_for_slave_param.inc for description.
 
25
#
 
26
# $slave_skip_counter
 
27
#   If set, skip this number of events. If not set, skip one event.
 
28
#
 
29
# $not_switch_connection If set, don't switch to slave and don't switch back
 
30
# master.
 
31
#
25
32
 
26
33
echo --source include/wait_for_slave_sql_error_and_skip.inc;
27
 
connection slave;
 
34
if (!$not_switch_connection)
 
35
{
 
36
  connection slave;
 
37
}
28
38
source include/wait_for_slave_sql_error.inc;
29
 
if ($show_sql_error)
30
 
{
31
 
  let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
32
 
  echo Last_SQL_Error = $error;
33
 
}
34
39
 
35
40
# skip the erroneous statement
36
 
set global sql_slave_skip_counter=1;
 
41
if ($slave_skip_counter) {
 
42
  eval SET GLOBAL SQL_SLAVE_SKIP_COUNTER= $slave_skip_counter;
 
43
}
 
44
if (!$slave_skip_counter) {
 
45
  SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 
46
}
37
47
source include/start_slave.inc;
38
 
connection master;
 
48
if (!$not_switch_connection)
 
49
{
 
50
  connection master;
 
51
}