diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-07-24 15:45:42 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-07-24 15:45:42 -0300 |
commit | 8ec2f3d0d1943a282648bd0fe708539a539b18cc (patch) | |
tree | 97c922ce909fe27e454cb40b715ce727b941f8f3 /sql/event_scheduler.cc | |
parent | 2bc6b6a80099ddb5b57e3d3c8be120e6596daa08 (diff) | |
parent | b4bf7dd31e39cd98f5794e4d7ef71cf03d0669dd (diff) | |
download | mariadb-git-8ec2f3d0d1943a282648bd0fe708539a539b18cc.tar.gz |
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.
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r-- | sql/event_scheduler.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 78aad2b4c3d..8c0025f9ed4 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -158,6 +158,7 @@ deinit_event_thread(THD *thd) thread_count--; thread_running--; delete thd; + pthread_cond_broadcast(&COND_thread_count); pthread_mutex_unlock(&LOCK_thread_count); } @@ -418,6 +419,7 @@ Event_scheduler::start() thread_count--; thread_running--; delete new_thd; + pthread_cond_broadcast(&COND_thread_count); pthread_mutex_unlock(&LOCK_thread_count); } end: @@ -550,6 +552,7 @@ error: thread_count--; thread_running--; delete new_thd; + pthread_cond_broadcast(&COND_thread_count); pthread_mutex_unlock(&LOCK_thread_count); } delete event_name; |