summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-03-21 19:20:44 +0100
committerSergei Golubchik <serg@mariadb.org>2017-03-21 19:20:44 +0100
commit09a2107b1b2f5567b8a50afec9e54a33284c6233 (patch)
treea9f544eb24b6b5ec510fa580cd997356671996d3 /sql/slave.cc
parentbbf0c9d4c35034c8634cd9607712d94fac089127 (diff)
parent0d622bed4f1a1484af747840c39325c67d7767d4 (diff)
downloadmariadb-git-09a2107b1b2f5567b8a50afec9e54a33284c6233.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 47bdf5eb3e8..484dfe81a76 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -519,13 +519,22 @@ int init_slave()
if (active_mi->host[0] && !opt_skip_slave_start)
{
- if (start_slave_threads(0, /* No active thd */
- 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(0, /* No active thd */
+ 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;