diff options
author | Venkatesh Duggirala <venkatesh.duggirala@oracle.com> | 2013-01-02 16:31:58 +0530 |
---|---|---|
committer | Venkatesh Duggirala <venkatesh.duggirala@oracle.com> | 2013-01-02 16:31:58 +0530 |
commit | 39323920302a039ac7e3a80052fbd68d31e5e75d (patch) | |
tree | 7dd36d76fc6d62327ef5cefc6e124d7d55cdf501 /mysys/my_error.c | |
parent | 10f8266d50ec134e72d9562e29d676c00249d9bb (diff) | |
download | mariadb-git-39323920302a039ac7e3a80052fbd68d31e5e75d.tar.gz |
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.
include/my_sys.h:
Provision to call sql_print_warning from mysys files
mysys/errors.c:
Replace my_error/my_printf_error with
sql_print_warning() which prints the warning in error log.
mysys/my_error.c:
implementation of my_printf_warning
mysys/my_write.c:
Adding logic to break infinite loop in the simulation
sql/mysqld.cc:
Provision to call sql_print_warning from mysys files
Diffstat (limited to 'mysys/my_error.c')
-rw-r--r-- | mysys/my_error.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mysys/my_error.c b/mysys/my_error.c index 20d8438a712..5167598bfae 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -129,6 +129,28 @@ int my_printf_error(uint error, const char *format, myf MyFlags, ...) } /* + Warning as printf + + SYNOPSIS + my_printf_warning() + format> Format string + ...> variable list +*/ +void(*sql_print_warning_hook)(const char *format,...); +void my_printf_warning(const char *format, ...) +{ + va_list args; + char wbuff[ERRMSGSIZE]; + DBUG_ENTER("my_printf_warning"); + DBUG_PRINT("my", ("Format: %s", format)); + va_start(args,format); + (void) my_vsnprintf (wbuff, sizeof(wbuff), format, args); + va_end(args); + (*sql_print_warning_hook)(wbuff); + DBUG_VOID_RETURN; +} + +/* Give message using error_handler_hook SYNOPSIS |