I have an event which bas created 2012-10-26. It is supposed to create a copy of a table every 1th in the month. Tables were created for 2012-11-01, 2012-12-01, 2013-01-01, 2013-02-01, 2013-04-01, 2014-04-01 and thats it.
As it can be seen below, the event should be active, but last execution was 2014-04-22, very weird as it should only run around change of month.
Logs are long gone and deleted.
Anybody has a good suggestion to what went wrong?
And more important, for to secure that this kind does not happen again.
mysql> SELECT * FROM `event` where name = 'Historik'\G;
*************************** 1. row ***************************
db: tgate
name: Historik
body: BEGIN
SET @create_query =REPLACE('CREATE TABLE `inbound_peer_numbers_XXX` as select * from inbound_peer_numbers where active=\'t\'','XXX',
DATE_ADD( LAST_DAY( DATE_SUB( CURDATE( ) , INTERVAL 1 MONTH ) ) , INTERVAL 1 DAY ));
prepare create_table_stmt FROM @create_query;
execute create_table_stmt ;
DEALLOCATE PREPARE create_table_stmt;
END
definer:
admin@172.30.0.3
execute_at: NULL
interval_value: 1
interval_field: MONTH
created: 2012-10-26 16:08:17
modified: 2012-10-26 16:08:17
last_executed: 2014-04-22 06:32:06
starts: 2012-10-31 23:00:00
ends: NULL
status: ENABLED
on_completion: DROP
sql_mode:
comment:
originator: 17230022
time_zone: SYSTEM
character_set_client: utf8
collation_connection: utf8_general_ci
db_collation: latin1_swedish_ci
body_utf8: BEGIN
SET @create_query =REPLACE('CREATE TABLE `inbound_peer_numbers_XXX` as select * from inbound_peer_numbers where active='t'','XXX',
DATE_ADD( LAST_DAY( DATE_SUB( CURDATE( ) , INTERVAL 1 MONTH ) ) , INTERVAL 1 DAY ));
prepare create_table_stmt FROM @create_query;
execute create_table_stmt ;
DEALLOCATE PREPARE create_table_stmt;
END