• Alexander Nozdrin's avatar
    Backport of patch for Bug#46267. · f740dff0
    Alexander Nozdrin authored
    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.
    ------------------------------------------------------------
    f740dff0
mysqld.cc 321 KB