summaryrefslogtreecommitdiff
path: root/sql/event_scheduler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r--sql/event_scheduler.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index bf16ddcb05a..ab6f0cdccaa 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -104,7 +104,7 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et)
err->get_message_octet_length(), system_charset_info);
DBUG_ASSERT(err->get_level() < 3);
(sql_print_message_handlers[err->get_level()])("%*s", err_msg.length(),
- err_msg.c_ptr());
+ err_msg.c_ptr_safe());
}
DBUG_VOID_RETURN;
}
@@ -665,7 +665,14 @@ Event_scheduler::stop()
/* thd could be 0x0, when shutting down */
sql_print_information("Event Scheduler: "
"Waiting for the scheduler thread to reply");
- COND_STATE_WAIT(thd, NULL, "Waiting scheduler to stop");
+
+ /*
+ Wait only 2 seconds, as there is a small chance the thread missed the
+ above awake() call and we may have to do it again
+ */
+ struct timespec top_time;
+ set_timespec(top_time, 2);
+ COND_STATE_WAIT(thd, &top_time, "Waiting scheduler to stop");
} while (state == STOPPING);
DBUG_PRINT("info", ("Scheduler thread has cleaned up. Set state to INIT"));
sql_print_information("Event Scheduler: Stopped");