summaryrefslogtreecommitdiff
path: root/sql/event_queue.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/event_queue.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/event_queue.cc')
-rw-r--r--sql/event_queue.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index 719a837cbfb..04d4f858b43 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -65,10 +65,10 @@ int event_queue_element_compare_q(void *vptr, uchar* a, uchar *b)
my_time_t lhs = left->execute_at;
my_time_t rhs = right->execute_at;
- if (left->status == Event_queue_element::DISABLED)
- return right->status != Event_queue_element::DISABLED;
+ if (left->status == Event_parse_data::DISABLED)
+ return right->status != Event_parse_data::DISABLED;
- if (right->status == Event_queue_element::DISABLED)
+ if (right->status == Event_parse_data::DISABLED)
return 1;
return (lhs < rhs ? -1 : (lhs > rhs ? 1 : 0));
@@ -198,7 +198,7 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element,
/* Will do nothing if the event is disabled */
new_element->compute_next_execution_time();
- if (new_element->status != Event_queue_element::ENABLED)
+ if (new_element->status != Event_parse_data::ENABLED)
{
delete new_element;
*created= FALSE;
@@ -236,8 +236,8 @@ Event_queue::update_event(THD *thd, LEX_STRING dbname, LEX_STRING name,
DBUG_ENTER("Event_queue::update_event");
DBUG_PRINT("enter", ("thd: 0x%lx et=[%s.%s]", (long) thd, dbname.str, name.str));
- if ((new_element->status == Event_queue_element::DISABLED) ||
- (new_element->status == Event_queue_element::SLAVESIDE_DISABLED))
+ if ((new_element->status == Event_parse_data::DISABLED) ||
+ (new_element->status == Event_parse_data::SLAVESIDE_DISABLED))
{
DBUG_PRINT("info", ("The event is disabled."));
/*
@@ -452,7 +452,7 @@ Event_queue::recalculate_activation_times(THD *thd)
for (i= queue.elements; i > 0; i--)
{
Event_queue_element *element = (Event_queue_element*)queue_element(&queue, i - 1);
- if (element->status != Event_queue_element::DISABLED)
+ if (element->status != Event_parse_data::DISABLED)
break;
/*
This won't cause queue re-order, because we remove
@@ -615,14 +615,14 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
DBUG_PRINT("info", ("Ready for execution"));
top->mark_last_executed(thd);
if (top->compute_next_execution_time())
- top->status= Event_queue_element::DISABLED;
+ top->status= Event_parse_data::DISABLED;
DBUG_PRINT("info", ("event %s status is %d", top->name.str, top->status));
top->execution_count++;
(*event_name)->dropped= top->dropped;
top->update_timing_fields(thd);
- if (top->status == Event_queue_element::DISABLED)
+ if (top->status == Event_parse_data::DISABLED)
{
DBUG_PRINT("info", ("removing from the queue"));
sql_print_information("Event Scheduler: Last execution of %s.%s. %s",