From 361ad4bd0b9d256d56eac8f66d8f7fc01e43371d Mon Sep 17 00:00:00 2001 From: "magnus.blaudd@oracle.com" <> Date: Thu, 2 Oct 2014 15:58:02 +0200 Subject: Bug#19553099 EXPIRE_LOGS_DAYS=1 CRASH MYSQLD DURING RESTART, DBUG_SYNC(NULL, ...) - Restarting mysqld with --expire-log-days=1 triggers 'log_in_use()' to be called while current_thd is NULL. - Check current_thd before calling DEBUG_SYNC() to avoid passing NULL pointer to DEBUG_SYNC() - Wrap debug code construct inside #ifndef DBUG_OFF like in other parts of the file --- sql/sql_repl.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql/sql_repl.cc') diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 343e128af7a..8bbb8c52d95 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -248,7 +248,10 @@ bool log_in_use(const char* log_name) size_t log_name_len = strlen(log_name) + 1; THD *tmp; bool result = 0; - DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count"); +#ifndef BDUG_OFF + if (current_thd) + DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count"); +#endif mysql_mutex_lock(&LOCK_thread_count); I_List_iterator it(threads); -- cgit v1.2.1