summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 381417c353b..fb26856f811 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3628,9 +3628,16 @@ static int init_slave_thread(THD* thd, Master_info *mi,
thd->system_thread = (thd_type == SLAVE_THD_SQL) ?
SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO;
+ if (init_thr_lock())
+ {
+ thd->cleanup();
+ DBUG_RETURN(-1);
+ }
+
/* We must call store_globals() before doing my_net_init() */
- if (init_thr_lock() || thd->store_globals() ||
- my_net_init(&thd->net, 0, thd, MYF(MY_THREAD_SPECIFIC)) ||
+ thd->store_globals();
+
+ if (my_net_init(&thd->net, 0, thd, MYF(MY_THREAD_SPECIFIC)) ||
IF_DBUG(simulate_error & (1<< thd_type), 0))
{
thd->cleanup();