summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorunknown <thek@adventure.(none)>2008-05-09 09:43:02 +0200
committerunknown <thek@adventure.(none)>2008-05-09 09:43:02 +0200
commit3cf9e6eb6b341a763b06febbaa4a0d0ac672408f (patch)
tree09591f37c2d93fb66dd1f852e60e38e672485ccf /sql/mysqld.cc
parentae7c0deaf99dc7741e42e8333f70694099e2c4af (diff)
downloadmariadb-git-3cf9e6eb6b341a763b06febbaa4a0d0ac672408f.tar.gz
Bug#35997 Event scheduler seems to let the server crash, if it is embedded.
The event scheduler was not designed to work in embedded mode. This patch disables and excludes the event scheduler when the server is compiled for embedded build. libmysqld/Makefile.am: Reduce the amount of event code in an embedded build. mysql-test/t/events_trans.test: Disable test if run in embedded mode. sql/Makefile.am: Introduce definition HAVE_EVENT_SCHEDULER and one new source file. sql/event_data_objects.cc: Refactor Event_parse_data to new file. sql/event_data_objects.h: Refactor Event_parse_data to new file. Move global definitions to new file. sql/event_queue.cc: Move all parsed items to Event_parse_data for easier modularization. sql/events.cc: Move all parsed items to Event_parse_data for easier modularization. sql/mysqld.cc: Disable the event schedular subsystem if the server is compiled in embedded mode. sql/set_var.cc: Disable the event schedular subsystem if the server is compiled in embedded mode. sql/set_var.h: Disable the event schedular subsystem if the server is compiled in embedded mode. sql/sql_db.cc: Disable the event schedular subsystem if the server is compiled in embedded mode. sql/sql_parse.cc: Disable the event schedular subsystem if the server is compiled in embedded mode. sql/sql_show.cc: Disable the event schedular subsystem if the server is compiled in embedded mode. sql/sql_test.cc: Disable the event schedular subsystem if the server is compiled in embedded mode. sql/sql_yacc.yy: Only include event-code needed for parsing to reduce impact on embedded build. Move all constants to Event_parse_data class. mysql-test/r/events_embedded.result: Add test case to make sure the 'event_scheduler' can't be activated in embedded mode. mysql-test/r/is_embedded.require: Add test case to make sure the 'event_scheduler' can't be activated in embedded mode. mysql-test/t/events_embedded.test: Add test case to make sure the 'event_scheduler' can't be activated in embedded mode. sql/event_parse_data.cc: New file. Extracted Event_parse data into a new file. sql/event_parse_data.h: New file. Extracted Event_parse data into a new file.
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index f619899f3b1..0c1ad3ffc69 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3498,7 +3498,9 @@ static int init_thread_environment()
(void) pthread_mutex_init(&LOCK_server_started, MY_MUTEX_INIT_FAST);
(void) pthread_cond_init(&COND_server_started,NULL);
sp_cache_init();
+#ifdef HAVE_EVENT_SCHEDULER
Events::init_mutexes();
+#endif
/* Parameter for threads created for connections */
(void) pthread_attr_init(&connection_attrib);
(void) pthread_attr_setdetachstate(&connection_attrib,
@@ -7831,8 +7833,12 @@ mysqld_get_one_option(int optid,
}
#endif
case OPT_EVENT_SCHEDULER:
+#ifndef HAVE_EVENT_SCHEDULER
+ sql_perror("Event scheduler is not supported in embedded build.");
+#else
if (Events::set_opt_event_scheduler(argument))
exit(1);
+#endif
break;
case (int) OPT_SKIP_NEW:
opt_specialflag|= SPECIAL_NO_NEW_FUNC;