mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#27597 mysqld-debug broken
- Send errors from RTC(Runtime Error Check) to stderr instead of popping up an MessageBox asking to debug
This commit is contained in:
@ -262,6 +262,34 @@ void my_parameter_handler(const wchar_t * expression, const wchar_t * function,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __MSVC_RUNTIME_CHECKS
|
||||||
|
#include <rtcapi.h>
|
||||||
|
|
||||||
|
/* Turn off runtime checks for 'handle_rtc_failure' */
|
||||||
|
#pragma runtime_checks("", off)
|
||||||
|
|
||||||
|
/*
|
||||||
|
handle_rtc_failure
|
||||||
|
Catch the RTC error and dump it to stderr
|
||||||
|
*/
|
||||||
|
|
||||||
|
int handle_rtc_failure(int err_type, const char *file, int line,
|
||||||
|
const char* module, const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
va_start(args, format);
|
||||||
|
fprintf(stderr, "Error:");
|
||||||
|
vfprintf(stderr, format, args);
|
||||||
|
fprintf(stderr, " At %s:%d\n", file, line);
|
||||||
|
va_end(args);
|
||||||
|
(void) fflush(stderr);
|
||||||
|
|
||||||
|
return 0; /* Error is handled */
|
||||||
|
}
|
||||||
|
#pragma runtime_checks("", on)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static void my_win_init(void)
|
static void my_win_init(void)
|
||||||
{
|
{
|
||||||
HKEY hSoftMysql ;
|
HKEY hSoftMysql ;
|
||||||
@ -292,6 +320,14 @@ static void my_win_init(void)
|
|||||||
_set_invalid_parameter_handler(my_parameter_handler);
|
_set_invalid_parameter_handler(my_parameter_handler);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __MSVC_RUNTIME_CHECKS
|
||||||
|
/*
|
||||||
|
Install handler to send RTC (Runtime Error Check) warnings
|
||||||
|
to log file
|
||||||
|
*/
|
||||||
|
_RTC_SetErrorFunc(handle_rtc_failure);
|
||||||
|
#endif
|
||||||
|
|
||||||
_tzset();
|
_tzset();
|
||||||
|
|
||||||
/* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
|
/* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
|
||||||
|
Reference in New Issue
Block a user