diff options
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r-- | sql/sys_vars.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 8bb9f57157e..9526933933f 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -667,6 +667,7 @@ static bool event_scheduler_check(sys_var *self, THD *thd, set_var *var) } static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type) { + int err_no= 0; uint opt_event_scheduler_value= Events::opt_event_scheduler; mysql_mutex_unlock(&LOCK_global_system_variables); /* @@ -686,11 +687,14 @@ static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type) for deadlocks. See bug#51160. */ bool ret= opt_event_scheduler_value == Events::EVENTS_ON - ? Events::start() + ? Events::start(&err_no) : Events::stop(); mysql_mutex_lock(&LOCK_global_system_variables); if (ret) - my_error(ER_EVENT_SET_VAR_ERROR, MYF(0), 0); + { + Events::opt_event_scheduler= Events::EVENTS_OFF; + my_error(ER_EVENT_SET_VAR_ERROR, MYF(0), err_no); + } return ret; } |