mirror of
https://github.com/MariaDB/server.git
synced 2026-04-23 00:35:32 +02:00
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.
This commit is contained in:
parent
ae7c0deaf9
commit
3cf9e6eb6b
20 changed files with 745 additions and 670 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue