mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
WL#1034 (update)
- fixed silly bug, the main thread restarted but did not execute events, Quite currious why many calls to pthread_mutex_init() do not lead to abort() sql/event.cc: - remove mysql_event_table_exists - fix possible crash when table is 0x0 sql/event_executor.cc: - make event_executor_running_global_var volatile - fix erroneous reinitilization of a mutex, why did it not crash in debug mode? why pthread_mutex_init() does not abort() in case the mutex was not deinitted beforehand? - first initialization of event_executor_running_global_var inside init_mutexes() - remove debug if() sql/event_priv.h: - remove unneeded definitions sql/event_timed.cc: make backup and then restore the open table state of thd
This commit is contained in:
21
sql/event.cc
21
sql/event.cc
@ -64,14 +64,10 @@ Warning:
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
bool mysql_event_table_exists= 1;
|
||||
QUEUE EVEX_EQ_NAME;
|
||||
MEM_ROOT evex_mem_root;
|
||||
|
||||
|
||||
|
||||
void
|
||||
evex_queue_init(EVEX_QUEUE_TYPE *queue)
|
||||
{
|
||||
@ -175,7 +171,6 @@ event_timed_compare(event_timed **a, event_timed **b)
|
||||
else
|
||||
return 0;
|
||||
|
||||
// return my_time_compare(&(*a)->execute_at, &(*b)->execute_at);
|
||||
}
|
||||
|
||||
|
||||
@ -204,23 +199,13 @@ TABLE *evex_open_event_table(THD *thd, enum thr_lock_type lock_type)
|
||||
bool not_used;
|
||||
DBUG_ENTER("open_proc_table");
|
||||
|
||||
/*
|
||||
Speed up things if the table doesn't exists. *table_exists
|
||||
is set when we create or read stored procedure or on flush privileges.
|
||||
*/
|
||||
if (!mysql_event_table_exists)
|
||||
DBUG_RETURN(0);
|
||||
|
||||
bzero((char*) &tables, sizeof(tables));
|
||||
tables.db= (char*) "mysql";
|
||||
tables.table_name= tables.alias= (char*) "event";
|
||||
tables.lock_type= lock_type;
|
||||
|
||||
if (simple_open_n_lock_tables(thd, &tables))
|
||||
{
|
||||
mysql_event_table_exists= 0;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
DBUG_RETURN(tables.table);
|
||||
}
|
||||
@ -638,7 +623,7 @@ done:
|
||||
et= 0;
|
||||
}
|
||||
// don't close the table if we haven't opened it ourselves
|
||||
if (!tbl)
|
||||
if (!tbl && table)
|
||||
close_thread_tables(thd);
|
||||
*ett= et;
|
||||
DBUG_RETURN(ret);
|
||||
@ -745,9 +730,7 @@ done:
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
-= Exported functions follow =-
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
The function exported to the world for creating of events.
|
||||
|
Reference in New Issue
Block a user