1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

A patch for Bug#45118 (mysqld.exe crashed in debug mode

on Windows in dbug.c) -- part 2: a patch for the DBUG subsystem
to detect misuse of DBUG_ENTER / DBUG_RETURN macros.
5.1 version.
This commit is contained in:
Alexander Nozdrin
2009-09-10 11:40:57 +04:00
parent d92b2238f9
commit 96c8843514
8 changed files with 144 additions and 73 deletions

View File

@ -408,29 +408,12 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
}
/**
Execute commands from bootstrap_file.
Used when creating the initial grant tables.
*/
pthread_handler_t handle_bootstrap(void *arg)
static void handle_bootstrap_impl(THD *thd)
{
THD *thd=(THD*) arg;
FILE *file=bootstrap_file;
char *buff;
const char* found_semicolon= NULL;
/* The following must be called before DBUG_ENTER */
thd->thread_stack= (char*) &thd;
if (my_thread_init() || thd->store_globals())
{
#ifndef EMBEDDED_LIBRARY
close_connection(thd, ER_OUT_OF_RESOURCES, 1);
#endif
thd->fatal_error();
goto end;
}
DBUG_ENTER("handle_bootstrap");
#ifndef EMBEDDED_LIBRARY
@ -525,6 +508,33 @@ pthread_handler_t handle_bootstrap(void *arg)
#endif
}
DBUG_VOID_RETURN;
}
/**
Execute commands from bootstrap_file.
Used when creating the initial grant tables.
*/
pthread_handler_t handle_bootstrap(void *arg)
{
THD *thd=(THD*) arg;
/* The following must be called before DBUG_ENTER */
thd->thread_stack= (char*) &thd;
if (my_thread_init() || thd->store_globals())
{
#ifndef EMBEDDED_LIBRARY
close_connection(thd, ER_OUT_OF_RESOURCES, 1);
#endif
thd->fatal_error();
goto end;
}
handle_bootstrap_impl(thd);
end:
net_end(&thd->net);
thd->cleanup();
@ -539,7 +549,8 @@ end:
my_thread_end();
pthread_exit(0);
#endif
DBUG_RETURN(0);
return 0;
}