Skip to content
Permalink
Browse files

bug: crash when sync() or close() of a log file fails on shutdown

because current_thd is NULL and ER() causes sigsegv
  • Loading branch information...
vuvova committed Apr 24, 2015
1 parent 8f499c3 commit c05d43100b4476a1145d3042ddb61fe792175500
Showing with 2 additions and 2 deletions.
  1. +2 −2 sql/log.cc
@@ -2491,14 +2491,14 @@ void MYSQL_LOG::close(uint exiting)
if (mysql_file_sync(log_file.file, MYF(MY_WME)) && ! write_error)
{
write_error= 1;
sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
sql_print_error(ER_THD_OR_DEFAULT(current_thd, ER_ERROR_ON_WRITE), name, errno);
}

if (!(exiting & LOG_CLOSE_DELAYED_CLOSE) &&
mysql_file_close(log_file.file, MYF(MY_WME)) && ! write_error)
{
write_error= 1;
sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
sql_print_error(ER_THD_OR_DEFAULT(current_thd, ER_ERROR_ON_WRITE), name, errno);
}
}

0 comments on commit c05d431

Please sign in to comment.
You can’t perform that action at this time.