summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
author <Li-Bing.Song@sun.com>2010-10-09 15:05:43 +0800
committer <Li-Bing.Song@sun.com>2010-10-09 15:05:43 +0800
commitb66825912a436cb263253bf47c535f3728ccbe85 (patch)
treeb0b97fc1f4f43afa6177fc65fb8c517c4302df62 /sql/slave.cc
parent9c82ecec3790614af7a5b4575758c0a003ef6bbd (diff)
downloadmariadb-git-b66825912a436cb263253bf47c535f3728ccbe85.tar.gz
Bug#55375 Transaction bigger than max_binlog_cache_size crashes slave
When slave executes a transaction bigger than slave's max_binlog_cache_size, slave will crash. It is caused by the assert that server should only roll back the statement but not the whole transaction if the error ER_TRANS_CACHE_FULL happens. But slave sql thread always rollbacks the whole transaction when an error happens. Ather this patch, we always clear any error set in sql thread(it is different from the error in 'SHOW SLAVE STATUS') and it is cleared before rolling back the transaction.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index f1e0962e7e8..353d4913208 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2343,7 +2343,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
else
{
exec_res= 0;
- end_trans(thd, ROLLBACK);
+ rli->cleanup_context(thd, 1);
/* chance for concurrent connection to get more locks */
safe_sleep(thd, min(rli->trans_retries, MAX_SLAVE_RETRY_PAUSE),
(CHECK_KILLED_FUNC)sql_slave_killed, (void*)rli);
@@ -3158,6 +3158,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
request is detected only by the present function, not by events), so we
must "proactively" clear playgrounds:
*/
+ thd->clear_error();
rli->cleanup_context(thd, 1);
/*
Some extra safety, which should not been needed (normally, event deletion