1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#43587: Putting event_scheduler=1 in init SQL file crashes

mysqld

The problem was that enabling the event scheduler inside a init
file caused the server to crash upon start-up. The crash occurred
because the event scheduler wasn't being initialized before the
commands in the init-file are processed.

The solution is to initialize the event scheduler before the init
file is read. The patch also disables the event scheduler during
bootstrap and makes the bootstrap operation robust in the
presence of background threads.

mysql-test/std_data/init_file.dat:
  Add test case for Bug#43587
sql/event_scheduler.cc:
  Signal that the thread_count has been decremented.
sql/events.cc:
  Disable the event scheduler during bootstrap.
sql/mysql_priv.h:
  Export variable.
sql/mysqld.cc:
  Initialize the event scheduler before commands are executed.
sql/sql_parse.cc:
  Signal that the bootstrap thread is done.
This commit is contained in:
Davi Arnaut
2009-07-24 15:45:42 -03:00
6 changed files with 61 additions and 29 deletions

View File

@ -533,8 +533,9 @@ end:
#ifndef EMBEDDED_LIBRARY
(void) pthread_mutex_lock(&LOCK_thread_count);
thread_count--;
(void) pthread_mutex_unlock(&LOCK_thread_count);
in_bootstrap= FALSE;
(void) pthread_cond_broadcast(&COND_thread_count);
(void) pthread_mutex_unlock(&LOCK_thread_count);
my_thread_end();
pthread_exit(0);
#endif