summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorSachin Setiya <sachin.setiya@mariadb.com>2017-03-20 18:11:56 +0530
committerSachin Setiya <sachin.setiya@mariadb.com>2017-03-20 18:11:56 +0530
commit9cf499724f38512630105974efab2ea8128345fd (patch)
tree121b19bc15337a52541870fba87321bc50144332 /sql/slave.cc
parent53c6195eede2b9959331bf11fa7679a108896bde (diff)
parent4c35dce2968ac715b72bb75c2d64d977868f718f (diff)
downloadmariadb-git-9cf499724f38512630105974efab2ea8128345fd.tar.gz
Merge branch '10.0' into bb-10.0-galera
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 694e9a2e673..8acf687a732 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -424,12 +424,21 @@ int init_slave()
if (active_mi->host[0] && !opt_skip_slave_start)
{
- if (start_slave_threads(1 /* need mutex */,
- 0 /* no wait for start*/,
- active_mi,
- master_info_file,
- relay_log_info_file,
- SLAVE_IO | SLAVE_SQL))
+ int error;
+ THD *thd= new THD;
+ thd->thread_stack= (char*) &thd;
+ thd->store_globals();
+
+ error= start_slave_threads(1 /* need mutex */,
+ 1 /* wait for start*/,
+ active_mi,
+ master_info_file,
+ relay_log_info_file,
+ SLAVE_IO | SLAVE_SQL);
+
+ thd->reset_globals();
+ delete thd;
+ if (error)
{
sql_print_error("Failed to create slave threads");
goto err;