Commit f740dff0 authored by Alexander Nozdrin's avatar Alexander Nozdrin

Backport of patch for Bug#46267.

Original revision:
------------------------------------------------------------
revno: 2801.10.16
committer: Vladislav Vaintroub <vvaintroub@mysql.com>
branch nick: mysql-azalea-bugfixing
timestamp: Mon 2009-08-10 13:26:23 +0200
message:
  Bug #46267 Shutdown with idle connection crash the server.
  
  The crash happens when mysqld logs a warning. The macro 
  ER() used in sql_print_warning references thread local storage
  variable via current_thd(), to output the warning in "current 
  user language". However, for the shutdown thread, 
  current_thd() will return NULL, and mysqld will crash while 
  derefencing NULL pointer.
  
  Solution: get error mesage text with ER_DEFAULT() macro 
  instead of ER(), this does not current_thd() and will output
  errors in default language.
------------------------------------------------------------
parent 8bc236e9
......@@ -1001,7 +1001,7 @@ static void close_connections(void)
if (tmp->vio_ok())
{
if (global_system_variables.log_warnings)
sql_print_warning(ER(ER_FORCING_CLOSE),my_progname,
sql_print_warning(ER_DEFAULT(ER_FORCING_CLOSE),my_progname,
tmp->thread_id,
(tmp->main_security_ctx.user ?
tmp->main_security_ctx.user : ""));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment