summaryrefslogtreecommitdiff
path: root/sql/event_data_objects.h
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2006-06-29 00:42:25 +0200
committerunknown <andrey@lmy004.>2006-06-29 00:42:25 +0200
commit9fa9378b2e5713250e1262879c7bc4d999e1bb40 (patch)
tree068608d07a92fd7d98e1c7f13c7b9dc9a3167f37 /sql/event_data_objects.h
parent739ea377bd702a6438d1491222e8ec671ad0fbf3 (diff)
downloadmariadb-git-9fa9378b2e5713250e1262879c7bc4d999e1bb40.tar.gz
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. mysql-test/r/events.result: update result mysql-test/t/events.test: disabled is actually wrong, should be disable, but because of the early checking it was never parsed. sql/event_data_objects.cc: move add init_xxx methods from Event_timed to Event_parse_data Event_parse data does not need definer_user and definer_host in Event_timed::compile() do not use lex.et, well there is no more lex.et :) sql/event_data_objects.h: move parsing responsibilities from Event_timed to Event_parse_data sql/event_db_repository.cc: No more Event_timed comes from parsing but Event_parse_data The initialization of Item*-s from parsing is done late, and not during the actual parsing. This is the right way to go because if an ALTER EVENT is inside a SP or CREATE EVENT it should not be executed (initialized) during parsing, as it was done. sql/event_db_repository.h: No more Event_timed comes from parsing but Event_parse_data The initialization of Item*-s from parsing is done late, and not during the actual parsing. This is the right way to go because if an ALTER EVENT is inside a SP or CREATE EVENT it should not be executed (initialized) during parsing, as it was done. sql/event_scheduler.cc: No more Event_timed comes from parsing but Event_parse_data The initialization of Item*-s from parsing is done late, and not during the actual parsing. This is the right way to go because if an ALTER EVENT is inside a SP or CREATE EVENT it should not be executed (initialized) during parsing, as it was done. sql/event_scheduler.h: No more Event_timed comes from parsing but Event_parse_data The initialization of Item*-s from parsing is done late, and not during the actual parsing. This is the right way to go because if an ALTER EVENT is inside a SP or CREATE EVENT it should not be executed (initialized) during parsing, as it was done. sql/events.cc: No more Event_timed comes from parsing but Event_parse_data The initialization of Item*-s from parsing is done late, and not during the actual parsing. This is the right way to go because if an ALTER EVENT is inside a SP or CREATE EVENT it should not be executed (initialized) during parsing, as it was done. sql/events.h: No more Event_timed comes from parsing but Event_parse_data The initialization of Item*-s from parsing is done late, and not during the actual parsing. This is the right way to go because if an ALTER EVENT is inside a SP or CREATE EVENT it should not be executed (initialized) during parsing, as it was done. sql/sql_lex.cc: lex->et_compile_phase and lex->et are no more. Use lex->event_parse_data sql/sql_lex.h: lex->et_compile_phase and lex->et are no more. Use lex->event_parse_data sql/sql_parse.cc: lex->et_compile_phase and lex->et are no more. Use lex->event_parse_data ACL checks were moved inside the Events subsystem. Also ending of the transaction is performed only just before doing disk operation. Therefore only when needed. sql/sql_yacc.yy: lex->et and lex->et_parse_phase are no more Use the specialized for parsing Event_parse_data
Diffstat (limited to 'sql/event_data_objects.h')
-rw-r--r--sql/event_data_objects.h63
1 files changed, 2 insertions, 61 deletions
diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h
index ff547cebd5b..d8df8dd1e6c 100644
--- a/sql/event_data_objects.h
+++ b/sql/event_data_objects.h
@@ -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();
@@ -172,30 +147,6 @@ public:
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);
bool
@@ -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);
-
};