diff options
author | unknown <andrey@lmy004.> | 2006-07-13 10:59:58 +0200 |
---|---|---|
committer | unknown <andrey@lmy004.> | 2006-07-13 10:59:58 +0200 |
commit | 31caa8c433ace692ea5f31c2c2ae0d872533e8de (patch) | |
tree | fb7407480fd7ae1b764e1bf59ec33047559bf6dd /sql/events.cc | |
parent | 628be8a71611bc86f7f0cf809b27d63bdd9b12c8 (diff) | |
download | mariadb-git-31caa8c433ace692ea5f31c2c2ae0d872533e8de.tar.gz |
WL #3337 (Events new architecture)
Final stroke, events should be loaded from disk on server startup.
Also check the validity of their bodies if possible during loading.
sql/event_data_objects.cc:
Remove Event_job_data::free_sp(), move the code to the destructor
Change the way we change the security context
Steal some code from sql_parse.cc
sql/event_data_objects.h:
Remove free_sp()
Make compile() public, to be used when booting for verifying the integrity of mysql.event
sql/event_queue.cc:
Make the queue load events from disk on server boot.
Compile and thus check for integrity the events.
sql/event_queue.h:
shift methods around. add queue_loaded boolean.
sql/event_scheduler.cc:
Rename init_event_thread() to pre_init_event_thread()
and make it more generic.
Add post_init_event_thread()
Export these two as well as deinit_event_thread().
Now it is quite easy to write code to spawn a new event thread
whenever needed.
sql/event_scheduler.h:
export pre_init_event_thread(), post_init_event_thread() and deinit_event_thread()
to simplify writing of thread functions.
sql/events.cc:
Events::init() returns only one error code, then make it bool
sql/events.h:
Events::init() returns only one error code, then make it bool
sql/mysqld.cc:
Check the return code of Events::init()
sql/sp_head.cc:
Add trace info
sql/sql_class.cc:
Reorganize thd::change_security_context() to load main_security_ctx
sql/sql_class.h:
Reorganize thd::change_security_context() to load main_security_ctx
sql/sql_lex.cc:
Initialize lex->spname
sql/sql_yacc.yy:
Add a comment
Diffstat (limited to 'sql/events.cc')
-rw-r--r-- | sql/events.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/events.cc b/sql/events.cc index 2a4ccbaf5ef..94ef8faa83d 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -556,11 +556,16 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */) 1 Error in case the scheduler can't start */ -int +bool Events::init() { + int res; DBUG_ENTER("Events::init"); - event_queue->init_queue(db_repository, scheduler); + if (event_queue->init_queue(db_repository, scheduler)) + { + sql_print_information("SCHEDULER: Error while loading from disk."); + DBUG_RETURN(TRUE); + } scheduler->init_scheduler(event_queue); /* it should be an assignment! */ @@ -571,7 +576,7 @@ Events::init() DBUG_RETURN(scheduler->start()); } - DBUG_RETURN(0); + DBUG_RETURN(FALSE); } |