diff options
-rw-r--r-- | sql/log.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc index bdf0b6fdc59..fc4b961e136 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -4178,6 +4178,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD *thd, bool create_new_log, mysql_mutex_unlock(&LOCK_xid_list); } + mysql_mutex_lock(&LOCK_thread_count); /* Save variables so that we can reopen the log */ save_name=name; name=0; // Protect against free @@ -4285,6 +4286,8 @@ err: if (error == 1) name= const_cast<char*>(save_name); + mysql_mutex_unlock(&LOCK_thread_count); + if (!is_relay_log) { xid_count_per_binlog *b; |