mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
WL#3337 (Events new architecture)
This cut No 7 should finish the part of fixing the parsing of the events : - Event_timed is no more used during parsing. Less problems because it has a mutex. Event_parse_data class is used during parsing. It is suited only for this purpose. It's pretty lightweight - Late checking of data from parsing is being performed. This should solve the problems of nested events in SP or other events (for the situation of no nested bodies). Before if an ALTER EVENT was in a SP, then when the SP was compiled, and not executed, the actual init_xxx methods of Event_timed were called, which is wrong. - It could be a side effect of using a specialized class, but test events_stress is now 25% quicker. Cut No8 will start splitting Event_scheduler into 2 parts, the QUEUE will be moved to Event_queue.
This commit is contained in:
@ -54,19 +54,9 @@ class Event_timed;
|
||||
bool
|
||||
event_timed_db_equal(Event_timed *et, LEX_STRING *db);
|
||||
|
||||
|
||||
/* Compares the whole identifier*/
|
||||
bool
|
||||
event_timed_identifier_equal(Event_timed *a, Event_timed *b);
|
||||
|
||||
/* Compares only the schema part of the identifier */
|
||||
bool
|
||||
event_timed_db_equal(sp_name *name, LEX_STRING *db);
|
||||
|
||||
|
||||
/* Compares the whole identifier*/
|
||||
bool
|
||||
event_timed_identifier_equal(sp_name *a, Event_timed *b);
|
||||
event_timed_identifier_equal(LEX_STRING db, LEX_STRING name, Event_timed *b);
|
||||
|
||||
|
||||
class Event_timed
|
||||
@ -123,7 +113,6 @@ public:
|
||||
enum enum_status status;
|
||||
sp_head *sphead;
|
||||
ulong sql_mode;
|
||||
const uchar *body_begin;
|
||||
|
||||
bool dropped;
|
||||
bool free_sphead_on_delete;
|
||||
@ -138,9 +127,6 @@ public:
|
||||
DBUG_RETURN(p);
|
||||
}
|
||||
|
||||
static void *operator new(size_t size, MEM_ROOT *mem_root)
|
||||
{ return (void*) alloc_root(mem_root, (uint) size); }
|
||||
|
||||
static void operator delete(void *ptr, size_t size)
|
||||
{
|
||||
DBUG_ENTER("Event_timed::delete(ptr,size)");
|
||||
@ -150,17 +136,6 @@ public:
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
static void operator delete(void *ptr, MEM_ROOT *mem_root)
|
||||
{
|
||||
/*
|
||||
Don't free the memory it will be done by the mem_root but
|
||||
we need to call the destructor because we free other resources
|
||||
which are not allocated on the root but on the heap, or we
|
||||
deinit mutexes.
|
||||
*/
|
||||
DBUG_ASSERT(0);
|
||||
}
|
||||
|
||||
Event_timed();
|
||||
|
||||
~Event_timed();
|
||||
@ -171,30 +146,6 @@ public:
|
||||
void
|
||||
deinit_mutexes();
|
||||
|
||||
int
|
||||
init_definer(THD *thd);
|
||||
|
||||
int
|
||||
init_execute_at(THD *thd, Item *expr);
|
||||
|
||||
int
|
||||
init_interval(THD *thd, Item *expr, interval_type new_interval);
|
||||
|
||||
void
|
||||
init_name(THD *thd, sp_name *spn);
|
||||
|
||||
int
|
||||
init_starts(THD *thd, Item *starts);
|
||||
|
||||
int
|
||||
init_ends(THD *thd, Item *ends);
|
||||
|
||||
void
|
||||
init_body(THD *thd);
|
||||
|
||||
void
|
||||
init_comment(THD *thd, LEX_STRING *set_comment);
|
||||
|
||||
int
|
||||
load_from_row(MEM_ROOT *mem_root, TABLE *table);
|
||||
|
||||
@ -231,9 +182,6 @@ public:
|
||||
void
|
||||
free_sp();
|
||||
|
||||
bool
|
||||
has_equal_db(Event_timed *etn);
|
||||
|
||||
int
|
||||
kill_thread(THD *thd);
|
||||
|
||||
@ -268,12 +216,9 @@ public:
|
||||
LEX_STRING dbname;
|
||||
LEX_STRING name;
|
||||
LEX_STRING body;
|
||||
|
||||
LEX_STRING definer_user;
|
||||
LEX_STRING definer_host;
|
||||
LEX_STRING definer;// combination of user and host
|
||||
|
||||
LEX_STRING comment;
|
||||
|
||||
Item* item_starts;
|
||||
Item* item_ends;
|
||||
Item* item_execute_at;
|
||||
@ -316,10 +261,6 @@ public:
|
||||
|
||||
void
|
||||
init_body(THD *thd);
|
||||
|
||||
void
|
||||
init_comment(THD *thd, LEX_STRING *set_comment);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user