Browse Source

Apply the following MySQL's fix:

Bug #46212 safe_process: FATAL ERROR, Unknown option: --nocore
Also fixed mysqld.cc to avoid popup-boxes
pull/843/head
Sergey Petrunya 16 years ago
parent
commit
23958fe046
  1. 10
      mysql-test/lib/My/SafeProcess/safe_process_win.cc
  2. 7
      sql/mysqld.cc

10
mysql-test/lib/My/SafeProcess/safe_process_win.cc

@ -163,6 +163,7 @@ int main(int argc, const char** argv )
HANDLE job_handle;
HANDLE wait_handles[NUM_HANDLES]= {0};
PROCESS_INFORMATION process_info= {0};
BOOL nocore= FALSE;
sprintf(safe_process_name, "safe_process[%d]", pid);
@ -204,6 +205,10 @@ int main(int argc, const char** argv )
if ((parent_pid= atoi(start)) == 0)
die("Invalid value '%s' passed to --parent-id", start);
}
else if (strcmp(arg, "--nocore") == 0)
{
nocore= TRUE;
}
else
die("Unknown option: %s", arg);
}
@ -241,6 +246,11 @@ int main(int argc, const char** argv )
&jeli, sizeof(jeli)) == 0)
message("SetInformationJobObject failed, continue anyway...");
/* Avoid popup box */
if (nocore)
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX
| SEM_NOOPENFILEERRORBOX);
#if 0
/* Setup stdin, stdout and stderr redirect */
si.dwFlags= STARTF_USESTDHANDLES;

7
sql/mysqld.cc

@ -2194,8 +2194,7 @@ static void init_signals(void)
win_install_sigabrt_handler();
if(opt_console)
SetConsoleCtrlHandler(console_event_handler,TRUE);
else
{
/* Avoid MessageBox()es*/
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
@ -2211,8 +2210,8 @@ static void init_signals(void)
exception filter is not guaranteed to work in all situation
(like heap corruption or stack overflow)
*/
SetErrorMode(SetErrorMode(0)|SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
}
SetErrorMode(SetErrorMode(0) | SEM_FAILCRITICALERRORS
| SEM_NOOPENFILEERRORBOX);
SetUnhandledExceptionFilter(my_unhandler_exception_filter);
}

Loading…
Cancel
Save