1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#37051 Replication rules not evaluated correctly

Backporting patch to 5.0.
This commit is contained in:
He Zhenxing
2009-03-05 18:10:44 +08:00
parent 62d5d85c5d
commit b4fdb8aec1
15 changed files with 594 additions and 27 deletions

View File

@ -0,0 +1,6 @@
--connection master
--sync_slave_with_master
--connection slave
--disable_query_log
STOP SLAVE;
--enable_query_log

View File

@ -0,0 +1,21 @@
# ==== Purpose ====
#
# Issues START SLAVE on the current connection. Then waits until both
# the IO and SQL threads have started, or until a timeout is reached.
#
# Please use this instead of 'START SLAVE', to reduce the risk of test
# case bugs.
#
# ==== Usage ====
#
# source include/wait_for_slave_to_start.inc;
#
# Parameters to this macro are $slave_timeout and
# $master_connection. See wait_for_slave_param.inc for
# descriptions.
--disable_query_log
START SLAVE;
--enable_query_log
--echo include/start_slave.inc
source include/wait_for_slave_to_start.inc;

View File

@ -0,0 +1,21 @@
# ==== Purpose ====
#
# Issues STOP SLAVE on the current connection. Then waits until both
# the IO and SQL threads have stopped, or until a timeout is reached.
#
# Please use this instead of 'STOP SLAVE', to reduce the risk of test
# case bugs.
#
# ==== Usage ====
#
# source include/wait_for_slave_to_start.inc;
#
# Parameters to this macro are $slave_timeout and
# $master_connection. See wait_for_slave_param.inc for
# descriptions.
--disable_query_log
STOP SLAVE;
--enable_query_log
--echo include/stop_slave.inc
source include/wait_for_slave_to_stop.inc;

View File

@ -0,0 +1,40 @@
# ==== Purpose ====
#
# Waits until the SQL thread of the current connection has got an
# error, or until a timeout is reached. Also waits until the SQL
# thread has completely stopped.
#
# ==== Usage ====
#
# source include/wait_for_slave_sql_error.inc;
#
# Parameters:
#
# $slave_sql_errno
# The expected SQL error number. This is required.
# (After BUG#41956 has been fixed, this will be required to be a
# symbolic name instead of a number.)
#
# $slave_timeout
# See wait_for_slave_param.inc for description.
#
# $master_connection
# See wait_for_slave_param.inc for description.
if (`SELECT '$slave_sql_errno' = ''`) {
--echo !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_fro_slave_sql_error.inc
exit;
}
let $slave_param= Slave_SQL_Running;
let $slave_param_value= No;
let $slave_error_message= Failed while waiting for slave to stop the SQL thread (expecting error in the SQL thread);
source include/wait_for_slave_param.inc;
# NOTE: on mysql-5.0, there is no way to distinguish slave SQL error from IO error
let $_error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1);
if (`SELECT '$_error' != '$slave_sql_errno'`) {
--echo Slave stopped with wrong error code: $_error (expected $slave_sql_errno)
source include/show_rpl_debug_info.inc;
exit;
}

View File

@ -0,0 +1,39 @@
# ==== 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.
echo --source include/wait_for_slave_sql_error_and_skip.inc;
connection slave;
source include/wait_for_slave_sql_error.inc;
if ($show_sql_error)
{
# NOTE: on mysql-5.0, there is no way to distinguish slave SQL error from IO error
let $error= query_get_value("SHOW SLAVE STATUS", Last_Error, 1);
echo Last_SQL_Error = $error;
}
# skip the erroneous statement
set global sql_slave_skip_counter=1;
source include/start_slave.inc;
connection master;