diff options
author | magnus.blaudd@oracle.com <> | 2014-10-02 15:58:02 +0200 |
---|---|---|
committer | magnus.blaudd@oracle.com <> | 2014-10-02 15:58:02 +0200 |
commit | 361ad4bd0b9d256d56eac8f66d8f7fc01e43371d (patch) | |
tree | 46c39c222732b01aa624999174cc0d8f11ad7619 | |
parent | d6d45fa3d86c6998ed5d3ec9a7cdc2268766de01 (diff) | |
download | mariadb-git-361ad4bd0b9d256d56eac8f66d8f7fc01e43371d.tar.gz |
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
-rw-r--r-- | sql/sql_repl.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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<THD> it(threads); |