Below is the list of changes that have just been committed into a local
5.1 repository of anozdrin. When anozdrin does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-02-21 14:49:27+03:00, anozdrin@quad. +2 -0
Fix for Bug#33065: Mysql not writing general query logs after
sending SIGHUP.
There were two problems:
- after some recent fix, the server started to crash after
receiving SIGHUP. That happened because LEX of new THD-object
was not properly initialized.
- user-specified log options were ignored when logs were reopened.
The fix is to 1) initialize LEX and 2) take user-specified options
into account.
There is no test case in this CS, because our test suite does not
support sending SIGHUP to the server.
sql/mysqld.cc@stripped, 2008-02-21 14:49:26+03:00, anozdrin@quad. +12 -2
Use proper logging after SIGHUP.
sql/sql_parse.cc@stripped, 2008-02-21 14:49:26+03:00, anozdrin@quad. +1 -0
Initialize LEX of new THD -- it is required to avoid crash
in SIGHUP handling.
diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc
--- a/sql/mysqld.cc 2008-02-14 11:52:52 +03:00
+++ b/sql/mysqld.cc 2008-02-21 14:49:26 +03:00
@@ -2573,8 +2573,18 @@ 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);
+ if (log_output_options & LOG_NONE)
+ {
+ logger.set_handlers(LOG_FILE,
+ opt_slow_log ? LOG_TABLE : LOG_NONE,
+ opt_log ? LOG_TABLE : LOG_NONE);
+ }
+ else
+ {
+ 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:
diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc 2008-02-19 15:58:00 +03:00
+++ b/sql/sql_parse.cc 2008-02-21 14:49:26 +03:00
@@ -6448,6 +6448,7 @@ bool reload_acl_and_cache(THD *thd, ulon
{
thd->thread_stack= (char*) &tmp_thd;
thd->store_globals();
+ lex_start(thd);
}
if (thd)
{