summaryrefslogtreecommitdiff
path: root/sql/event_scheduler.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-07-24 15:45:42 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-07-24 15:45:42 -0300
commit97ff334b371331e34ec741a021d8aa0b5449480e (patch)
tree97c922ce909fe27e454cb40b715ce727b941f8f3 /sql/event_scheduler.cc
parent9c72a7bfeac53a3402621bc451f25c81d0713811 (diff)
parent31997022d79f55922e4915fe649619f2dcc1ab40 (diff)
downloadmariadb-git-97ff334b371331e34ec741a021d8aa0b5449480e.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.
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r--sql/event_scheduler.cc3
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;