summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@quad.>2008-02-21 14:49:27 +0300
committerunknown <anozdrin/alik@quad.>2008-02-21 14:49:27 +0300
commitd8c8fd5b4feff08ab3d0480d9b2df78c43b8bf3a (patch)
tree31314bc88842b48366a320036f5b485470622373
parentffd88cb2bd1bb31a85036a422145b325a36d629e (diff)
downloadmariadb-git-d8c8fd5b4feff08ab3d0480d9b2df78c43b8bf3a.tar.gz
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: Use proper logging after SIGHUP. sql/sql_parse.cc: Initialize LEX of new THD -- it is required to avoid crash in SIGHUP handling.
-rw-r--r--sql/mysqld.cc14
-rw-r--r--sql/sql_parse.cc1
2 files changed, 13 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 9c4e6f9e2a2..a982a8f4809 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -2573,8 +2573,18 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
(TABLE_LIST*) 0, &not_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 --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a78ac978a4a..ccc8b80ffc8 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6448,6 +6448,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
{
thd->thread_stack= (char*) &tmp_thd;
thd->store_globals();
+ lex_start(thd);
}
if (thd)
{