Skip to content

Commit

Permalink
bug: crash when sync() or close() of a log file fails on shutdown
Browse files Browse the repository at this point in the history
because current_thd is NULL and ER() causes sigsegv
  • Loading branch information
vuvova committed Apr 27, 2015
1 parent 8f499c3 commit c05d431
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sql/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit c05d431

Please sign in to comment.