MySQL Forums
Forum List  »  Events (Job Scheduler)

CREATE EVENT IF NOT EXISTS behavior
Posted by: Jeremy Herrman
Date: November 06, 2007 03:17PM

Hello,

I've been evaluating the event scheduler for my company and came across an issue with creating events using CREATE EVENT IF NOT EXISTS. I'm using 5.1.22 on Windows XP.

I would create an event like so:

CREATE EVENT IF NOT EXISTS testdb.test_event
ON SCHEDULE EVERY 30 SECOND
DO CALL testdb.do_stored_proc();

The event would be created and executed every 30 seconds as expected. I checked the Windows Application Event Log to see two "Information" entries every 30 seconds:

"Event Scheduler: [root@%].[testdb.test_event] started in thread ###." and "Event Scheduler: [root@%].[testdb.test_event] executed successfully in thread ###."

This is all as expected and documented. However, as testing went on for longer, I noticed an extremely excessive amount of entries in the event log for the test event (over 600 per schedule cycle). It seems as if even though the even had already been created, the "CREATE EVENT IF NOT EXISTS" still creates another thread that gets executed according to the set schedule. If I query the number of events in the mysql.events table, it lists only 1 entry for test_event. Without checking the event log, I would have had no idea that MySQL was spawning so many threads every 30 seconds.

I'm no MySQL expert, but it seems like this could never be the intended behavior of the "CREATE EVENT IF NOT EXISTS" statement. If anyone could shed some light on whether this makes sense I'd love to hear it.

Thanks,
Jeremy

Options: ReplyQuote


Subject
Views
Written By
Posted
CREATE EVENT IF NOT EXISTS behavior
9411
November 06, 2007 03:17PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.