diff options
Diffstat (limited to 'sql/event_scheduler.cc')
-rwxr-xr-x | sql/event_scheduler.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 8446fe75c8f..ecddcb7ca46 100755 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -100,7 +100,7 @@ Event_worker_thread::print_warnings(THD *thd, Event_job_data *et) err_msg.append(err->msg, strlen(err->msg), system_charset_info); DBUG_ASSERT(err->level < 3); (sql_print_message_handlers[err->level])("%*s", err_msg.length(), - err_msg.c_ptr()); + err_msg.c_ptr_safe()); } DBUG_VOID_RETURN; } @@ -648,7 +648,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"); |