summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2009-05-23 00:29:41 +0100
committerLuis Soares <luis.soares@sun.com>2009-05-23 00:29:41 +0100
commitc8c688daa83f1d01e1e1e0352c0014bd668400b8 (patch)
tree3bc299dfaa7d9794471a88458cd84239d94de3cb /sql/slave.cc
parent2c5e79bbe46aa91e5c51e4eb886d3cb485c8c2ca (diff)
parent8e589d1d06d48471bcef7164e458f6d9cefec2ec (diff)
downloadmariadb-git-c8c688daa83f1d01e1e1e0352c0014bd668400b8.tar.gz
BUG#41725: upmerge: 5.0-bt --> 5.1-bt
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 6333c978505..c379a67201a 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -389,6 +389,13 @@ void init_slave_skip_errors(const char* arg)
DBUG_VOID_RETURN;
}
+static void set_thd_in_use_temporary_tables(Relay_log_info *rli)
+{
+ TABLE *table;
+
+ for (table= rli->save_temporary_tables ; table ; table= table->next)
+ table->in_use= rli->sql_thd;
+}
int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock)
{
@@ -2757,6 +2764,7 @@ pthread_handler_t handle_slave_sql(void *arg)
}
thd->init_for_queries();
thd->temporary_tables = rli->save_temporary_tables; // restore temp tables
+ set_thd_in_use_temporary_tables(rli); // (re)set sql_thd in use for saved temp tables
pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd);
pthread_mutex_unlock(&LOCK_thread_count);
@@ -3003,6 +3011,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
DBUG_ASSERT(rli->sql_thd == thd);
THD_CHECK_SENTRY(thd);
rli->sql_thd= 0;
+ set_thd_in_use_temporary_tables(rli); // (re)set sql_thd in use for saved temp tables
pthread_mutex_lock(&LOCK_thread_count);
THD_CHECK_SENTRY(thd);
delete thd;