summaryrefslogtreecommitdiff
path: root/sql/events.h
diff options
context:
space:
mode:
authorandrey@lmy004. <>2006-07-10 13:44:43 +0200
committerandrey@lmy004. <>2006-07-10 13:44:43 +0200
commite3d0524bbd79f85d166e7ec369d6a1f612a8c3d1 (patch)
tree692560cb267120b449f56b1df9db9a918e5c7477 /sql/events.h
parent3b840adee7817d141fa9f5935b1d05243e6a8df4 (diff)
downloadmariadb-git-e3d0524bbd79f85d166e7ec369d6a1f612a8c3d1.tar.gz
WL#3337 (Event scheduler new architecture)
This patch introduces specialized Event data objects Event_basic as parent. Event_queue_element used for queue storage Event_timed used for SHOW EVENTS/ I_S.EVENTS / SHOW CREATE EVENT Event_job_data using during execution. Methods were moved out of Event_timed to other classes. This patch also introduces Events::LOCK_event_metadata. This patch gives new implementation of Events::dump_internal_status(). Now both the Event_scheduler and Event_queue return information during their ::dump_internal_status(). Shortened a bit the runtime for executing events test cases.
Diffstat (limited to 'sql/events.h')
-rw-r--r--sql/events.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/sql/events.h b/sql/events.h
index bb9fe7a8fc5..f825a75934f 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -20,6 +20,7 @@ class sp_name;
class Event_parse_data;
class Event_db_repository;
class Event_queue;
+class Event_queue_element;
class Event_scheduler_ng;
/* Return codes */
@@ -41,6 +42,7 @@ sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs);
class Events
{
public:
+ friend class Event_queue_element;
/*
Quite NOT the best practice and will be removed once
Event_timed::drop() and Event_timed is fixed not do drop directly
@@ -83,7 +85,8 @@ public:
uint *rows_affected);
int
- drop_event(THD *thd, sp_name *name, bool if_exists, uint *rows_affected);
+ drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists,
+ uint *rows_affected, bool only_from_disk);
int
drop_schema_events(THD *thd, char *db);
@@ -102,13 +105,9 @@ public:
static int
fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */);
- int
+ bool
dump_internal_status(THD *thd);
- Event_queue *event_queue;
- Event_scheduler_ng *scheduler_ng;
- Event_db_repository *db_repository;
-
private:
/* Singleton DP is used */
Events(){}
@@ -117,6 +116,12 @@ private:
/* Singleton instance */
static Events singleton;
+ Event_queue *event_queue;
+ Event_scheduler_ng *scheduler_ng;
+ Event_db_repository *db_repository;
+
+ pthread_mutex_t LOCK_event_metadata;
+
/* Prevent use of these */
Events(const Events &);
void operator=(Events &);