Loading sql/event_scheduler.cc +7 −19 Original line number Diff line number Diff line Loading @@ -505,7 +505,6 @@ event_worker_thread(void *arg) THD *thd; /* needs to be first for thread_stack */ Worker_thread_param *param= (Worker_thread_param *) arg; Event_timed *event= param->et; MEM_ROOT worker_mem_root; int ret; bool startup_error= FALSE; Security_context *save_ctx; Loading Loading @@ -550,8 +549,6 @@ event_worker_thread(void *arg) if (!startup_error) { uint flags; thd->init_for_queries(); thd->enable_slow_log= TRUE; Loading Loading @@ -1272,10 +1269,7 @@ Event_scheduler::run(THD *thd) abstime.tv_nsec= 0; while (is_running_or_suspended()) { TIME time_now_utc; Event_timed *et; my_bool tmp; time_t now_utc; LOCK_SCHEDULER_DATA(); if (check_n_wait_for_non_empty_queue(thd)) Loading Loading @@ -1356,7 +1350,7 @@ Event_scheduler::run(THD *thd) break; } } end_loop: thd->proc_info= (char *)"Cleaning"; LOCK_SCHEDULER_DATA(); Loading Loading @@ -1509,7 +1503,6 @@ Event_scheduler::clean_queue(THD *thd) { CHARSET_INFO *scs= system_charset_info; uint i; int ret; DBUG_ENTER("Event_scheduler::clean_queue"); DBUG_PRINT("enter", ("thd=%p", thd)); Loading Loading @@ -1630,7 +1623,6 @@ Event_scheduler::stop_all_running_events(THD *thd) enum Event_scheduler::enum_error_code Event_scheduler::stop() { int ret; THD *thd= current_thd; DBUG_ENTER("Event_scheduler::stop"); DBUG_PRINT("enter", ("thd=%p", current_thd)); Loading Loading @@ -1697,7 +1689,6 @@ enum Event_scheduler::enum_error_code Event_scheduler::suspend_or_resume( enum Event_scheduler::enum_suspend_or_resume action) { enum enum_error_code ret; DBUG_ENTER("Event_scheduler::suspend_or_resume"); DBUG_PRINT("enter", ("action=%d", action)); Loading Loading @@ -1887,18 +1878,17 @@ Event_scheduler::check_n_wait_for_non_empty_queue(THD *thd) Error code of pthread_mutex_lock() */ inline int inline void Event_scheduler::lock_data(const char *func, uint line) { int ret; DBUG_ENTER("Event_scheduler::lock_mutex"); DBUG_PRINT("enter", ("mutex_lock=%p func=%s line=%u", &LOCK_scheduler_data, func, line)); ret= pthread_mutex_lock(&LOCK_scheduler_data); pthread_mutex_lock(&LOCK_scheduler_data); mutex_last_locked_in_func= func; mutex_last_locked_at_line= line; mutex_scheduler_data_locked= TRUE; DBUG_RETURN(ret); DBUG_VOID_RETURN; } Loading @@ -1909,12 +1899,9 @@ Event_scheduler::lock_data(const char *func, uint line) Event_scheduler::unlock_data() mutex Mutex to unlock line The line number on which the unlock is done RETURN VALUE Error code of pthread_mutex_lock() */ inline int inline void Event_scheduler::unlock_data(const char *func, uint line) { DBUG_ENTER("Event_scheduler::UNLOCK_mutex"); Loading @@ -1923,7 +1910,8 @@ Event_scheduler::unlock_data(const char *func, uint line) mutex_last_unlocked_at_line= line; mutex_scheduler_data_locked= FALSE; mutex_last_unlocked_in_func= func; DBUG_RETURN(pthread_mutex_unlock(&LOCK_scheduler_data)); pthread_mutex_unlock(&LOCK_scheduler_data); DBUG_VOID_RETURN; } Loading sql/event_scheduler.h +2 −2 Original line number Diff line number Diff line Loading @@ -236,10 +236,10 @@ class Event_scheduler bool mutex_scheduler_data_locked; /* helper functions for working with mutexes & conditionals */ int void lock_data(const char *func, uint line); int void unlock_data(const char *func, uint line); int Loading sql/event_timed.cc +0 −4 Original line number Diff line number Diff line Loading @@ -931,7 +931,6 @@ bool Event_timed::compute_next_execution_time() { TIME time_now; my_time_t now; int tmp; DBUG_ENTER("Event_timed::compute_next_execution_time"); Loading Loading @@ -1372,7 +1371,6 @@ Event_timed::get_create_event(THD *thd, String *buf) int Event_timed::execute(THD *thd, MEM_ROOT *mem_root) { Security_context *save_ctx; /* this one is local and not needed after exec */ Security_context security_ctx; int ret= 0; Loading @@ -1392,8 +1390,6 @@ Event_timed::execute(THD *thd, MEM_ROOT *mem_root) if (!sphead && (ret= compile(thd, mem_root))) goto done; /* Now we are sure we have valid this->sphead so we can copy the context */ sphead->m_security_ctx= security_ctx; /* THD::~THD will clean this or if there is DROP DATABASE in the SP then it will be free there. It should not point to our buffer which is allocated Loading Loading
sql/event_scheduler.cc +7 −19 Original line number Diff line number Diff line Loading @@ -505,7 +505,6 @@ event_worker_thread(void *arg) THD *thd; /* needs to be first for thread_stack */ Worker_thread_param *param= (Worker_thread_param *) arg; Event_timed *event= param->et; MEM_ROOT worker_mem_root; int ret; bool startup_error= FALSE; Security_context *save_ctx; Loading Loading @@ -550,8 +549,6 @@ event_worker_thread(void *arg) if (!startup_error) { uint flags; thd->init_for_queries(); thd->enable_slow_log= TRUE; Loading Loading @@ -1272,10 +1269,7 @@ Event_scheduler::run(THD *thd) abstime.tv_nsec= 0; while (is_running_or_suspended()) { TIME time_now_utc; Event_timed *et; my_bool tmp; time_t now_utc; LOCK_SCHEDULER_DATA(); if (check_n_wait_for_non_empty_queue(thd)) Loading Loading @@ -1356,7 +1350,7 @@ Event_scheduler::run(THD *thd) break; } } end_loop: thd->proc_info= (char *)"Cleaning"; LOCK_SCHEDULER_DATA(); Loading Loading @@ -1509,7 +1503,6 @@ Event_scheduler::clean_queue(THD *thd) { CHARSET_INFO *scs= system_charset_info; uint i; int ret; DBUG_ENTER("Event_scheduler::clean_queue"); DBUG_PRINT("enter", ("thd=%p", thd)); Loading Loading @@ -1630,7 +1623,6 @@ Event_scheduler::stop_all_running_events(THD *thd) enum Event_scheduler::enum_error_code Event_scheduler::stop() { int ret; THD *thd= current_thd; DBUG_ENTER("Event_scheduler::stop"); DBUG_PRINT("enter", ("thd=%p", current_thd)); Loading Loading @@ -1697,7 +1689,6 @@ enum Event_scheduler::enum_error_code Event_scheduler::suspend_or_resume( enum Event_scheduler::enum_suspend_or_resume action) { enum enum_error_code ret; DBUG_ENTER("Event_scheduler::suspend_or_resume"); DBUG_PRINT("enter", ("action=%d", action)); Loading Loading @@ -1887,18 +1878,17 @@ Event_scheduler::check_n_wait_for_non_empty_queue(THD *thd) Error code of pthread_mutex_lock() */ inline int inline void Event_scheduler::lock_data(const char *func, uint line) { int ret; DBUG_ENTER("Event_scheduler::lock_mutex"); DBUG_PRINT("enter", ("mutex_lock=%p func=%s line=%u", &LOCK_scheduler_data, func, line)); ret= pthread_mutex_lock(&LOCK_scheduler_data); pthread_mutex_lock(&LOCK_scheduler_data); mutex_last_locked_in_func= func; mutex_last_locked_at_line= line; mutex_scheduler_data_locked= TRUE; DBUG_RETURN(ret); DBUG_VOID_RETURN; } Loading @@ -1909,12 +1899,9 @@ Event_scheduler::lock_data(const char *func, uint line) Event_scheduler::unlock_data() mutex Mutex to unlock line The line number on which the unlock is done RETURN VALUE Error code of pthread_mutex_lock() */ inline int inline void Event_scheduler::unlock_data(const char *func, uint line) { DBUG_ENTER("Event_scheduler::UNLOCK_mutex"); Loading @@ -1923,7 +1910,8 @@ Event_scheduler::unlock_data(const char *func, uint line) mutex_last_unlocked_at_line= line; mutex_scheduler_data_locked= FALSE; mutex_last_unlocked_in_func= func; DBUG_RETURN(pthread_mutex_unlock(&LOCK_scheduler_data)); pthread_mutex_unlock(&LOCK_scheduler_data); DBUG_VOID_RETURN; } Loading
sql/event_scheduler.h +2 −2 Original line number Diff line number Diff line Loading @@ -236,10 +236,10 @@ class Event_scheduler bool mutex_scheduler_data_locked; /* helper functions for working with mutexes & conditionals */ int void lock_data(const char *func, uint line); int void unlock_data(const char *func, uint line); int Loading
sql/event_timed.cc +0 −4 Original line number Diff line number Diff line Loading @@ -931,7 +931,6 @@ bool Event_timed::compute_next_execution_time() { TIME time_now; my_time_t now; int tmp; DBUG_ENTER("Event_timed::compute_next_execution_time"); Loading Loading @@ -1372,7 +1371,6 @@ Event_timed::get_create_event(THD *thd, String *buf) int Event_timed::execute(THD *thd, MEM_ROOT *mem_root) { Security_context *save_ctx; /* this one is local and not needed after exec */ Security_context security_ctx; int ret= 0; Loading @@ -1392,8 +1390,6 @@ Event_timed::execute(THD *thd, MEM_ROOT *mem_root) if (!sphead && (ret= compile(thd, mem_root))) goto done; /* Now we are sure we have valid this->sphead so we can copy the context */ sphead->m_security_ctx= security_ctx; /* THD::~THD will clean this or if there is DROP DATABASE in the SP then it will be free there. It should not point to our buffer which is allocated Loading