Bug #33651 | Slow queries logged to table instead of file after SIGHUP | ||
---|---|---|---|
Submitted: | 3 Jan 2008 13:46 | Modified: | 25 Jan 2008 15:53 |
Reporter: | Colin Dean | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Logging | Severity: | S2 (Serious) |
Version: | 5.1.22-rc | OS: | Linux (CentOS 5.0 x86_64) |
Assigned to: | CPU Architecture: | Any | |
Tags: | file, log, SIGHUP, slow, table |
[3 Jan 2008 13:46]
Colin Dean
[4 Jan 2008 12:39]
Colin Dean
I've figured out the answer to my supplementary question, how to empty the mysql.slow_log table. This seems to work: USE mysql; DROP TABLE IF EXISTS new_slow_log; CREATE TABLE new_slow_log like slow_log; RENAME TABLE slow_log to old_slow_log, new_slow_log to slow_log; DROP TABLE old_slow_log; Perhaps this could be documented in the manual? I note that in a master-slave setup, these commands propagate from master to slave, but entries are not replicated (either before or after emptying), which I guess makes sense.
[4 Jan 2008 16:30]
Susanne Ebrecht
I think, this is a duplicate of bug #33065
[25 Jan 2008 15:53]
Colin Dean
I've tried the following 2 line patch, and it fixes the bug for me. I suspect it fixes Bug #33065 too, but I haven't tested that. diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc --- a/sql/mysqld.cc 2007-09-24 11:29:40 +01:00 +++ b/sql/mysqld.cc 2008-01-25 11:24:16 +00:00 @@ -2518,8 +2518,8 @@ pthread_handler_t signal_hand(void *arg (TABLE_LIST*) 0, ¬_used); // Flush logs } /* reenable logs after the options were reloaded */ - logger.set_handlers(LOG_FILE, opt_slow_log ? LOG_TABLE:LOG_NONE, - opt_log ? LOG_TABLE:LOG_NONE); + logger.set_handlers(LOG_FILE, opt_slow_log ? log_output_options:LOG_NONE, + opt_log ? log_output_options:LOG_NONE); break; #ifdef USE_ONE_SIGNAL_HAND case THR_SERVER_ALARM:
[14 Feb 2008 10:40]
Susanne Ebrecht
Many thanks for your help.