summaryrefslogtreecommitdiff
path: root/sql/event_queue.h
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2006-07-11 18:28:15 +0200
committerunknown <andrey@lmy004.>2006-07-11 18:28:15 +0200
commit42a8e2c9421854710679a0f6c3ceef6c0777ded4 (patch)
treef2fc5508efd161a1ef60e481f22fe90017197fa1 /sql/event_queue.h
parent084f74426b5f19b47984ef298309e9a4015940c3 (diff)
downloadmariadb-git-42a8e2c9421854710679a0f6c3ceef6c0777ded4.tar.gz
WL#3337 (Event scheduler new architecture)
More small fixes to the API : use LEX_STRING instead of LEX_STRING* and if error then return bool(true) instead of error code. Merged functions. Reduced usage of sp_name. Fixed a lot of function documentation errors. Added function documentation wherever needed. Removed some unused defines and error codes. Next to come is batch rename of Event_scheduler_ng to Event_scheduler. mysql-test/r/events.result: update result mysql-test/r/events_logs_tests.result: update result mysql-test/t/events.test: more test coverage mysql-test/t/events_logs_tests.test: fix test sql/event_data_objects.cc: Cosmetics. Fix function documentation whenever needed. Move Event_job_data::compile() next to Event_job_data::execute() sql/event_data_objects.h: Remove unneeded error codes and defines Move function declarations at the end of the header sql/event_db_repository.cc: Fix function documentation. Event_db_repository::update_event() now uses LEX_STRING *-s instead of sp_name . Lower coupling. sql/event_db_repository.h: Event_db_repository::update_event() now uses LEX_STRING *-s instead of sp_name . Lower coupling. find_event -> find_named_event find_event_by_name is not used externally, merge with load_named_event() sql/event_queue.cc: LEX_STRING* to LEX_STRING Fix comments. Fix and add function documentation. Remove Event_queue::events_count() as it is unused Change get_top_for_execution_if_time() to return status code as return value and the object is in out parameter. sql/event_queue.h: LEX_STRING* to LEX_STRING Fix comments. Fix and add function documentation. Remove Event_queue::events_count() as it is unused Change get_top_for_execution_if_time() to return status code as return value and the object is in out parameter. Try to detect also lock attemptions for deadlocks. sql/event_scheduler_ng.cc: Always execute on thd->mem_root Fix according to changed API of Event_queue::get_top_for_execution_if_time() sql/events.cc: Fix function documentation. Fix code after API changes of internal Event module classes. sql/events.h: sp_name -> LEX_STRINGs sql/sql_parse.cc: Fix according to changed API of Events::show_create_event() sql/sql_yacc.yy: Don't pass NULL as third parameter to sp_head::init_strings()
Diffstat (limited to 'sql/event_queue.h')
-rw-r--r--sql/event_queue.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/sql/event_queue.h b/sql/event_queue.h
index 142a866e5ba..15a28b4103d 100644
--- a/sql/event_queue.h
+++ b/sql/event_queue.h
@@ -16,7 +16,6 @@
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_basic;
class Event_db_repository;
class Event_job_data;
@@ -57,31 +56,28 @@ public:
void
drop_schema_events(THD *thd, LEX_STRING schema);
- uint
- events_count();
-
static bool
check_system_tables(THD *thd);
void
recalculate_activation_times(THD *thd);
- Event_job_data *
- get_top_for_execution_if_time(THD *thd, time_t now, struct timespec *abstime);
-
+ bool
+ get_top_for_execution_if_time(THD *thd, time_t now, Event_job_data **job_data,
+ struct timespec *abstime);
bool
dump_internal_status(THD *thd);
protected:
Event_queue_element *
- find_event(LEX_STRING db, LEX_STRING name, bool remove_from_q);
+ find_n_remove_event(LEX_STRING db, LEX_STRING name);
int
load_events_from_db(THD *thd);
void
drop_matching_events(THD *thd, LEX_STRING pattern,
- bool (*)(LEX_STRING *, Event_basic *));
+ bool (*)(LEX_STRING, Event_basic *));
void
empty_queue();
@@ -93,9 +89,12 @@ protected:
uint mutex_last_locked_at_line;
uint mutex_last_unlocked_at_line;
+ uint mutex_last_attempted_lock_at_line;
const char* mutex_last_locked_in_func;
const char* mutex_last_unlocked_in_func;
+ const char* mutex_last_attempted_lock_in_func;
bool mutex_queue_data_locked;
+ bool mutex_queue_data_attempting_lock;
/* helper functions for working with mutexes & conditionals */
void