summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/log.cc2
-rw-r--r--sql/mysqld.cc2
2 files changed, 3 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 619d5ffaccd..0b008e7abbb 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -10631,6 +10631,7 @@ binlog_background_thread(void *arg __attribute__((unused)))
thd->store_globals();
thd->security_ctx->skip_grants();
thd->set_command(COM_DAEMON);
+ THD_count::count--;
/*
Load the slave replication GTID state from the mysql.gtid_slave_pos
@@ -10720,6 +10721,7 @@ binlog_background_thread(void *arg __attribute__((unused)))
THD_STAGE_INFO(thd, stage_binlog_stopping_background_thread);
/* No need to use mutex as thd is not linked into other threads */
+ THD_count::count++;
delete thd;
my_thread_end();
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1e30d8f3644..d60eeb34962 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1781,7 +1781,6 @@ static void close_connections(void)
Events::deinit();
slave_prepare_for_shutdown();
- mysql_bin_log.stop_background_thread();
ack_receiver.stop();
/*
@@ -1965,6 +1964,7 @@ static void clean_up(bool print_message)
logger.cleanup_base();
injector::free_instance();
+ mysql_bin_log.stop_background_thread();
mysql_bin_log.cleanup();
my_tz_free();