summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2009-08-19 16:38:18 +0100
committerAlfranio Correia <alfranio.correia@sun.com>2009-08-19 16:38:18 +0100
commit8b9712c034e46a26291acfc145de677d84b825cd (patch)
treeaf613fdec79daadeeab6047cc9bf53a14f806034 /sql/slave.cc
parent2c190aeace420b38dd4ad426faed94387be69c52 (diff)
downloadmariadb-git-8b9712c034e46a26291acfc145de677d84b825cd.tar.gz
BUG#45694 Deadlock in replicated statement is not retried
If the SQL Thread fails to execute an event due to a temporary error (e.g. ER_LOCK_DEADLOCK) and the option "--slave_transaction_retries" is set the SQL Thread should not be aborted and the transaction should be restarted from the beginning and re-executed. Unfortunately, a wrong interpretation of the THD::is_fatal_error was preventing this behavior. In a nutshell, "this variable is set to TRUE if an execution of a compound statement cannot continue. In particular, it is used to disable access to the CONTINUE or EXIT handlers of stored routines. So even temporary errors may have this variable set. To fix the bug, we have done what follows: DBUG_ENTER("has_temporary_error"); - if (thd->is_fatal_error) - DBUG_RETURN(0); - DBUG_EXECUTE_IF("all_errors_are_temporary_errors", if (thd->main_da.is_error()) {
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc3
1 files changed, 0 insertions, 3 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 3b64e23ece5..1a903d8ac12 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2010,9 +2010,6 @@ static int has_temporary_error(THD *thd)
{
DBUG_ENTER("has_temporary_error");
- if (thd->is_fatal_error)
- DBUG_RETURN(0);
-
DBUG_EXECUTE_IF("all_errors_are_temporary_errors",
if (thd->main_da.is_error())
{