diff options
author | unknown <andrey@lmy004.> | 2006-06-28 14:22:14 +0200 |
---|---|---|
committer | unknown <andrey@lmy004.> | 2006-06-28 14:22:14 +0200 |
commit | 8ca78787a54f5d86f23147ca734e8e167a56b7b4 (patch) | |
tree | 5f8ea7fe8597821677207641a35819493c44dedd /sql/event_db_repository.h | |
parent | acefb78bc3fbf28376d8713e1dc9f056dc3cdbf6 (diff) | |
download | mariadb-git-8ca78787a54f5d86f23147ca734e8e167a56b7b4.tar.gz |
WL#3337 (Events new architecture)
Cut number 6. Move code from sql_show.cc to event_db_repository.cc
that more belongs to the latter.
sql/event_db_repository.cc:
move code that works with mysql.event from sql_show.cc to
event_db_repository.cc . Route through Event_db_repository's interface
which is proxied by class Events. The code relies on a function from
sql_show.cc which does the actual storage in the schema table. I think
it's better to leave the function there because the structure of
I_S.EVENTS is defined in sql_show.cc
sql/event_db_repository.h:
I_S / SHOW EVENTS handling hooks
sql/event_scheduler.cc:
use the pointer to db_repository which Event_scheduler already has
sql/events.cc:
Put a comment to get_instance
sql/events.h:
callback for I_S (sql_show.cc)
sql/sql_show.cc:
move code that belongs more to Event_db_repository than to here.
Use a callback of class Events. Only 1 function is left here, because
it copies data into the actual rows of I_S.EVENTS and belongs to this file.
sql/sql_show.h:
export this function will be called from event_db_repository.cc
Diffstat (limited to 'sql/event_db_repository.h')
-rw-r--r-- | sql/event_db_repository.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h index c0cfccf215a..1cbee96b68f 100644 --- a/sql/event_db_repository.h +++ b/sql/event_db_repository.h @@ -43,6 +43,17 @@ evex_db_find_event_by_name(THD *thd, const LEX_STRING dbname, const LEX_STRING ev_name, TABLE *table); +int +events_table_index_read_for_db(THD *thd, TABLE *schema_table, + TABLE *event_table); + +int +events_table_scan_all(THD *thd, TABLE *schema_table, TABLE *event_table); + +int +fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */); + + class Event_queue_element; class Event_db_repository @@ -58,9 +69,6 @@ public: deinit_repository(); int - open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table); - - int create_event(THD *thd, Event_timed *et, my_bool create_if_not, uint *rows_affected); @@ -86,11 +94,23 @@ public: int find_event_by_name(THD *thd, LEX_STRING db, LEX_STRING name, TABLE *table); -private: int + open_event_table(THD *thd, enum thr_lock_type lock_type, TABLE **table); + + int + fill_schema_events(THD *thd, TABLE_LIST *tables, char *db); + +private: + int drop_events_by_field(THD *thd, enum enum_events_table_field field, LEX_STRING field_value); + int + index_read_for_db_for_i_s(THD *thd, TABLE *schema_table, TABLE *event_table, + char *db); + + int + table_scan_all_for_i_s(THD *thd, TABLE *schema_table, TABLE *event_table); MEM_ROOT repo_root; |