diff options
author | Alfranio Correia <alfranio.correia@sun.com> | 2009-07-06 09:19:36 +0100 |
---|---|---|
committer | Alfranio Correia <alfranio.correia@sun.com> | 2009-07-06 09:19:36 +0100 |
commit | c31cc064817441c1d1140908d24e010549063813 (patch) | |
tree | 655a6712038426004565e009bf446a0bbe1a3c7c /sql | |
parent | d1873811461d886d77fa541a6cbd15cd05e06210 (diff) | |
parent | 7f95e0c94717ce5f3d4a1f3960c929f255d2cc70 (diff) | |
download | mariadb-git-c31cc064817441c1d1140908d24e010549063813.tar.gz |
auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 37 | ||||
-rw-r--r-- | sql/slave.cc | 19 | ||||
-rw-r--r-- | sql/slave.h | 1 |
3 files changed, 33 insertions, 24 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 493db62e7ef..5f77ab3dcc4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -369,6 +369,34 @@ int convert_handler_error(int error, THD* thd, TABLE *table) return (actual_error); } +inline bool concurrency_error_code(int error) +{ + switch (error) + { + case ER_LOCK_WAIT_TIMEOUT: + case ER_LOCK_DEADLOCK: + case ER_XA_RBDEADLOCK: + return TRUE; + default: + return (FALSE); + } +} + +inline bool unexpected_error_code(int unexpected_error) +{ + switch (unexpected_error) + { + case ER_NET_READ_ERROR: + case ER_NET_ERROR_ON_WRITE: + case ER_QUERY_INTERRUPTED: + case ER_SERVER_SHUTDOWN: + case ER_NEW_ABORTING_CONNECTION: + return(TRUE); + default: + return(FALSE); + } +} + /* pretty_print_str() */ @@ -3006,7 +3034,7 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli, DBUG_PRINT("query",("%s",thd->query)); if (ignored_error_code((expected_error= error_code)) || - !check_expected_error(thd,rli,expected_error)) + !unexpected_error_code(expected_error)) { if (flags2_inited) /* @@ -3138,8 +3166,8 @@ compare_errors: actual_error= thd->is_error() ? thd->main_da.sql_errno() : 0; DBUG_PRINT("info",("expected_error: %d sql_errno: %d", expected_error, actual_error)); - if ((expected_error != actual_error) && - expected_error && + if ((expected_error && expected_error != actual_error && + !concurrency_error_code(expected_error)) && !ignored_error_code(actual_error) && !ignored_error_code(expected_error)) { @@ -3158,7 +3186,8 @@ Default database: '%s'. Query: '%s'", /* If we get the same error code as expected, or they should be ignored. */ - else if (expected_error == actual_error || + else if ((expected_error == actual_error && + !concurrency_error_code(expected_error)) || ignored_error_code(actual_error)) { DBUG_PRINT("info",("error ignored")); diff --git a/sql/slave.cc b/sql/slave.cc index 0270db9253d..81be7064f89 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1884,25 +1884,6 @@ static ulong read_event(MYSQL* mysql, Master_info *mi, bool* suppress_warnings) DBUG_RETURN(len - 1); } - -int check_expected_error(THD* thd, Relay_log_info const *rli, - int expected_error) -{ - DBUG_ENTER("check_expected_error"); - - switch (expected_error) { - case ER_NET_READ_ERROR: - case ER_NET_ERROR_ON_WRITE: - case ER_QUERY_INTERRUPTED: - case ER_SERVER_SHUTDOWN: - case ER_NEW_ABORTING_CONNECTION: - DBUG_RETURN(1); - default: - DBUG_RETURN(0); - } -} - - /* Check if the current error is of temporary nature of not. Some errors are temporary in nature, such as diff --git a/sql/slave.h b/sql/slave.h index 160418955b5..a44a7eed83e 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -171,7 +171,6 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, bool rpl_master_erroneous_autoinc(THD* thd); const char *print_slave_db_safe(const char *db); -int check_expected_error(THD* thd, Relay_log_info const *rli, int error_code); void skip_load_data_infile(NET* net); void end_slave(); /* release slave threads */ |