summaryrefslogtreecommitdiff
path: root/sql/event_db_repository.h
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2011-05-27 16:23:08 +0700
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2011-05-27 16:23:08 +0700
commit56a735b78226f6de336c520936df3485d929d685 (patch)
treed17b7d2c30b9220ec11ab65b695fe616e6a2eb49 /sql/event_db_repository.h
parent861291f1ab26266b167cd644f189883528c66943 (diff)
downloadmariadb-git-56a735b78226f6de336c520936df3485d929d685.tar.gz
Fixed bug#12546938 (formerly known as 61005) - CREATE IF NOT EXIST EVENT
will create multiple running events. A CREATE IF NOT EXIST on an event that existed and was enabled caused multiple instances of the event to run. Disabling the event didn't help. If the event was dropped, the event stopped running, but when created again, multiple instances of the event were still running. The only way to get out of this situation was to restart the server. The problem was that Event_db_repository::create_event() didn't return enough information to discriminate between situation when event didn't exist and was created and when event did exist and was not created (but a warning was emitted). As result in the latter case event was added to in-memory queue of events second time. And this led to unwarranted multiple executions of the same event. The solution is to add out-parameter to Event_db_repository::create_event() method which will signal that event was not created because it already exists and so it should not be added to the in-memory queue. mysql-test/r/events_bugs.result: Added results for test for Bug#12546938. mysql-test/t/events_bugs.test: Added test for Bug#12546938. sql/event_db_repository.cc: Event_db_repository::create_event was modified: set newly added out-parameter event_already_exists to true value if event wasn't created because event already existed and IF NOT EXIST clause was present. sql/event_db_repository.h: Added out-parameter 'event_already_exists' to create_event() method. sql/events.cc: Events::create_event was modified: insert new element into event queue only if event was actually created.
Diffstat (limited to 'sql/event_db_repository.h')
-rw-r--r--sql/event_db_repository.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h
index ef778407d1e..a7d7b97ae3c 100644
--- a/sql/event_db_repository.h
+++ b/sql/event_db_repository.h
@@ -73,7 +73,8 @@ public:
Event_db_repository(){}
bool
- create_event(THD *thd, Event_parse_data *parse_data, my_bool create_if_not);
+ create_event(THD *thd, Event_parse_data *parse_data, bool create_if_not,
+ bool *event_already_exists);
bool
update_event(THD *thd, Event_parse_data *parse_data, LEX_STRING *new_dbname,