• Dmitry Shulga's avatar
    Fixed bug#12546938 (formerly known as 61005) - CREATE IF NOT EXIST EVENT · 8bb8385f
    Dmitry Shulga authored
    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.
    8bb8385f
event_db_repository.cc 33.9 KB