Commit aa78bb30 authored by Serge Kozlov's avatar Serge Kozlov

Bug#41186: Possible reason of bug is waiting any sql error on slave instead

exact number of error. The patch does following:
1) Add new parameter $slave_sql_errno for wait_for_slave_sql_error.inc
2) Add waiting error 1062 (Duplicate PK) for slave SQL thread in test case.
parent 4ae3c11c
...@@ -7,15 +7,29 @@ ...@@ -7,15 +7,29 @@
# #
# source include/wait_for_slave_sql_error.inc; # source include/wait_for_slave_sql_error.inc;
# #
# Parameters to this macro are $slave_timeout and # Parameters:
# $slave_keep_connection. See wait_for_slave_param.inc for #
# descriptions. # $slave_sql_errno
# Number of expected SQL error. If it skipped then any error
# will pass.
#
# $slave_timeout and
# See wait_for_slave_param.inc for descriptions.
#
# $slave_keep_connection.
# See wait_for_slave_param.inc for descriptions.
let $old_slave_param_comparison= $slave_param_comparison; let $old_slave_param_comparison= $slave_param_comparison;
let $slave_param= Last_SQL_Errno; let $slave_param= Last_SQL_Errno;
let $slave_param_comparison= !=; let $slave_param_comparison= !=;
let $slave_param_value= 0; let $slave_param_value= 0;
if ($slave_sql_errno) {
let $slave_param_comparison= =;
let $slave_param_value= $slave_sql_errno;
}
let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread; let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
source include/wait_for_slave_param.inc; source include/wait_for_slave_param.inc;
let $slave_error_message= ; let $slave_error_message= ;
......
...@@ -28,6 +28,7 @@ insert into t1 values(NULL,'new'); ...@@ -28,6 +28,7 @@ insert into t1 values(NULL,'new');
save_master_pos; save_master_pos;
connection slave; connection slave;
# wait until the slave tries to run the query, fails and aborts slave thread # wait until the slave tries to run the query, fails and aborts slave thread
let $slave_sql_errno= 1062;
source include/wait_for_slave_sql_error.inc; source include/wait_for_slave_sql_error.inc;
select * from t1 order by n; select * from t1 order by n;
delete from t1 where n = 2; delete from t1 where n = 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment