diff options
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 |