From 97dbb3562b0b230e01605f00e441e8a70d10b6a8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 7 Dec 2018 12:54:10 +0100 Subject: [PATCH] simplify usage of logger.set_handlers() --- sql/mysqld.cc | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c48ef12ff79..5e12eaf2deb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3458,21 +3458,14 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) REFRESH_GRANT | REFRESH_THREADS | REFRESH_HOSTS), (TABLE_LIST*) 0, ¬_used); // Flush logs - } - /* reenable logs after the options were reloaded */ - if (log_output_options & LOG_NONE) - { - logger.set_handlers(LOG_FILE, - global_system_variables.sql_log_slow ? - LOG_TABLE : LOG_NONE, - opt_log ? LOG_TABLE : LOG_NONE); - } - else - { - logger.set_handlers(LOG_FILE, - global_system_variables.sql_log_slow ? - log_output_options : LOG_NONE, - opt_log ? log_output_options : LOG_NONE); + + /* reenable logs after the options were reloaded */ + ulonglong fixed_log_output_options= + log_output_options & LOG_NONE ? LOG_TABLE : log_output_options; + + logger.set_handlers(LOG_FILE, global_system_variables.sql_log_slow + ? fixed_log_output_options : LOG_NONE, + opt_log ? fixed_log_output_options : LOG_NONE); } break; #ifdef USE_ONE_SIGNAL_HAND