Loading sql/log.cc +27 −11 Original line number Diff line number Diff line Loading @@ -676,20 +676,36 @@ bool LOGGER::flush_logs(THD *thd) /* reopen log files */ file_log_handler->flush(); /* flush tables, in the case they are enabled */ if (logger.is_log_tables_initialized) { /* this will lock and wait for all but the logger thread to release the This will lock and wait for all but the logger thread to release the tables. Then we could reopen log tables. Then release the name locks. NOTE: in fact, the first parameter used in lock_and_wait_for_table_name() and table_log_handler->flush() could be any non-NULL THD, as the underlying code makes certain assumptions about this. Here we use one of the logger handler THD's. Simply because it seems appropriate. */ lock_and_wait_for_table_name(thd, &close_slow_log); lock_and_wait_for_table_name(thd, &close_general_log); lock_and_wait_for_table_name(table_log_handler->general_log_thd, &close_slow_log); lock_and_wait_for_table_name(table_log_handler->general_log_thd, &close_general_log); /* deny others from logging to general and slow log, while reopening tables */ /* Deny others from logging to general and slow log, while reopening tables. */ logger.lock(); table_log_handler->flush(thd, &close_slow_log, &close_general_log); table_log_handler->flush(table_log_handler->general_log_thd, &close_slow_log, &close_general_log); /* end of log tables flush */ logger.unlock(); } return FALSE; } Loading Loading
sql/log.cc +27 −11 Original line number Diff line number Diff line Loading @@ -676,20 +676,36 @@ bool LOGGER::flush_logs(THD *thd) /* reopen log files */ file_log_handler->flush(); /* flush tables, in the case they are enabled */ if (logger.is_log_tables_initialized) { /* this will lock and wait for all but the logger thread to release the This will lock and wait for all but the logger thread to release the tables. Then we could reopen log tables. Then release the name locks. NOTE: in fact, the first parameter used in lock_and_wait_for_table_name() and table_log_handler->flush() could be any non-NULL THD, as the underlying code makes certain assumptions about this. Here we use one of the logger handler THD's. Simply because it seems appropriate. */ lock_and_wait_for_table_name(thd, &close_slow_log); lock_and_wait_for_table_name(thd, &close_general_log); lock_and_wait_for_table_name(table_log_handler->general_log_thd, &close_slow_log); lock_and_wait_for_table_name(table_log_handler->general_log_thd, &close_general_log); /* deny others from logging to general and slow log, while reopening tables */ /* Deny others from logging to general and slow log, while reopening tables. */ logger.lock(); table_log_handler->flush(thd, &close_slow_log, &close_general_log); table_log_handler->flush(table_log_handler->general_log_thd, &close_slow_log, &close_general_log); /* end of log tables flush */ logger.unlock(); } return FALSE; } Loading