0

I've set up an event in mysql to run every 24 hours starting 'tomorrow'. That's whats the event table is showing:

db  name    body            definer     execute_at  interval_value  interval_field  created                 modified                last_executed           starts ...
DBA P1      [BLOB - 51 B]   abc@%       NULL        24              HOUR            2014-02-01 15:10:19     2014-02-01 15:10:19     2014-02-01 16:08:14     2014-02-02 14:10:19

What's making trouble is, that allthough it should start on 2014-02-02 14:10:19 it has already executed on 2014-02-01 16:08:14 which isn't even 24 hours from the creation time?

What's wrong, any ideas?

This is the create statement:

CREATE EVENT `P1` 
  ON SCHEDULE EVERY 24 HOUR 
  STARTS CURRENT_TIMESTAMP + INTERVAL 24 HOUR 
  ON COMPLETION PRESERVE ENABLE DO ..some sql...
gipinani
  • 14,038
  • 12
  • 56
  • 85
Axel Amthor
  • 10,980
  • 1
  • 25
  • 44
  • everything looks right. Is it possible that you ran it w/o the delay once? – nycynik Feb 01 '14 at 16:56
  • no, it has been set up straight away like it is. – Axel Amthor Feb 01 '14 at 17:00
  • hmmm... I had a previous definition of that event with a two hours recurring time, but I deleted that and created new from scratch. can it be that this "schedule" still was running and triggered the new event with the same name? – Axel Amthor Feb 01 '14 at 17:03
  • I think you found it :) Yes. – nycynik Feb 02 '14 at 13:25
  • But that actualy would mean to get unpredictable side effects. Supposed I delete an event, schedule a new one withe something completely different at another time but with the same name would mean that this event will be executed at the old schedule? How can I prevent this, since even restarting the event thread doesn't stop that? – Axel Amthor Feb 02 '14 at 21:32
  • I don't think so. I think it just thinks this even ran in the past, because of the name. Just like when you modify an events actions, it will not change the history of runs. – nycynik Feb 03 '14 at 16:13

0 Answers0