From c72f687f21d6fb4750f3d05221be8b039ee11fdf Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Wed, 2 Jan 2013 16:31:58 +0530 Subject: BUG#11753923-SQL THREAD CRASHES ON DISK FULL Problem:If Disk becomes full while writing into the binlog, then the server instance hangs till someone frees the space. After user frees up the disk space, mysql server crashes with an assert (m_status != DA_EMPTY) Analysis: wait_for_free_space is being called in an infinite loop i.e., server instance will hang until someone frees up the space. So there is no need to set status bit in diagnostic area. Fix: Replace my_error/my_printf_error with sql_print_warning() which prints the warning in error log. --- mysys/my_write.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysys/my_write.c') diff --git a/mysys/my_write.c b/mysys/my_write.c index b545ab776b0..d0a59a605b6 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -36,6 +36,8 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) if (unlikely(!Count)) DBUG_RETURN(0); + DBUG_EXECUTE_IF ("simulate_file_write_error_once", + { DBUG_SET("+d,simulate_file_write_error");}); for (;;) { writenbytes= write(Filedes, Buffer, Count); @@ -69,6 +71,8 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) { wait_for_free_space(my_filename(Filedes), errors); errors++; + DBUG_EXECUTE_IF("simulate_file_write_error_once", + { DBUG_SET("-d,simulate_file_write_error");}); continue; } -- cgit v1.2.1