From ef9a97e6856ec8128b66a47b124ce3c09f0fd1bc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Jun 2006 11:51:11 +0200 Subject: WL#3337 (Event scheduler new architecture) Third cut to simplify parsing phase. Now DROP EVENT works. Overloaded few functions to be able to use either sp_name or pass two LEX_STRINGs instead of a Event_timed pointer. This is transitional and eventually the old functions will be removed. For now DROP EVENT also works, does not need anymore a parsing object (Event_timed) and definer initialization because everyone who has EVENT_ACL can drop events, and this is checked on execution time in sql_parse.cc from the security context, as it should be. sql/event_data_objects.cc: overload few functions sql/event_scheduler.cc: Event_scheduler::drop_event() actually does not need Event_timed object but just an identifier, hence pass only sp_name. Overloaded Event_scheduler::find_event() to work with sp_name object. Eventually the old version will be removed. This is being done as transitional step to be able to test frequently code. sql/event_scheduler.h: Event_scheduler::drop_event() actually does not need Event_timed object but just an identifier, hence pass only sp_name. Overloaded Event_scheduler::find_event() to work with sp_name object. Eventually the old version will be removed. This is being done as transitional step to be able to test frequently code. sql/events.cc: Change db_drop_event() not to use Event_timed, either coming from parsing or from Event_timed::drop, but use LEX_STRINGs. sp_name is not convinient because in Event_timed::drop a temporary object has to be created. Hence, dereference the sp_name in Events::drop_event() and pass the LEX_STRINGs. sql/events.h: Change db_drop_event() not to use Event_timed, either coming from parsing or from Event_timed::drop, but use LEX_STRINGs. sp_name is not convinient because in Event_timed::drop a temporary object has to be created. Hence, dereference the sp_name in Events::drop_event() and pass the LEX_STRINGs. sql/events_priv.h: Change db_drop_event() not to use Event_timed, either coming from parsing or from Event_timed::drop, but use LEX_STRINGs. sp_name is not convinient because in Event_timed::drop a temporary object has to be created. Hence, dereference the sp_name in Events::drop_event() and pass the LEX_STRINGs. sql/sql_parse.cc: SQLCOM_DROP_EVENT does not need lex->event_parse_data object and is more like SQLCOM_SHOW_CREATE_EVENT. Therefore, move it to the block that handles the latter. sql/sql_yacc.yy: DROP EVENT does not need a parsing object, just a name. Store it as lex->spname. Pretty similar handling to the one of SHOW CREATE EVENT. --- sql/events.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sql/events.h') diff --git a/sql/events.h b/sql/events.h index 055c9a371a4..d56a544493d 100644 --- a/sql/events.h +++ b/sql/events.h @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +class sp_name; class Event_timed; class Event_parse_data; @@ -56,8 +56,7 @@ public: sp_name *new_name, uint *rows_affected); static int - drop_event(THD *thd, Event_timed *et, Event_parse_data *parse_data, - bool drop_if_exists, uint *rows_affected); + drop_event(THD *thd, sp_name *name, bool drop_if_exists, uint *rows_affected); static int open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table); -- cgit v1.2.1