Commit 3d73cd23 authored by Igor Solodovnikov's avatar Igor Solodovnikov

Bug #17514920 MYSQL_THREAD_INIT() CALL WITHOUT MYSQL_INIT() IS CRASHING IN WINDOWS

It is error to call mysql_thread_init() before libmysql is initialized with mysql_library_init(). Thus to fix this bug we need to detect if library was initialized and return error result if mysql_thread_init() is called with uninitialized library.

Fixed by checking my_thread_global_init_done and returning nonzero if the library is not initialized.
parent 22e9aa1c
......@@ -313,6 +313,9 @@ my_bool my_thread_init(void)
struct st_my_thread_var *tmp;
my_bool error=0;
if (!my_thread_global_init_done)
return 1; /* cannot proceed with unintialized library */
#ifdef EXTRA_DEBUG_THREADS
fprintf(stderr,"my_thread_init(): thread_id: 0x%lx\n",
(ulong) pthread_self());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment