Bug #17493 Last executed column in information_schema.events is NULL after execution
Submitted: 16 Feb 2006 20:45 Modified: 13 Apr 2006 22:22
Reporter: Markus Popp
Status: Closed
Category:Server: SP Severity:S3 (Non-critical)
Version:5.1.6 OS:Linux (Linux)
Assigned to: Andrey Hristov Target Version:

[16 Feb 2006 20:45] Markus Popp
Description:
Even though I know for sure that the event has been executed (the one given in 'how to
repeat' is supposed to insert one row every 5 seconds and it actually has inserted the
rows), the LAST_EXECUTED column shows NULL.

How to repeat:
mysql> select * from information_schema.events\G
*************************** 1. row ***************************
 EVENT_CATALOG: NULL
  EVENT_SCHEMA: test
    EVENT_NAME: insertIntoTt
       DEFINER: mpopp@%
    EVENT_BODY:
BEGIN
  INSERT INTO test.tt (d) VALUES (floor(rand() * 20));
END
    EVENT_TYPE: RECURRING
    EXECUTE_AT: NULL
INTERVAL_VALUE: 5
INTERVAL_FIELD: INTERVAL_SECOND
      SQL_MODE: NULL
        STARTS: 2006-02-13 17:53:32
          ENDS: 0000-00-00 00:00:00
        STATUS: DISABLED
 ON_COMPLETION: NOT PRESERVE
       CREATED: 2006-02-16 20:24:07
  LAST_ALTERED: 2006-02-13 18:53:27
 LAST_EXECUTED: NULL
 EVENT_COMMENT:
1 row in set (0.01 sec)

mysql>

Suggested fix:
LAST_EXECUTED should show the date/time when the event has been executed last.
[16 Feb 2006 21:03] Andrey Hristov
Verified. If you select from mysql.event you will see the last executed time. a
->set_notnull() is missing. In addition last_executed is NULL on server startup with the
current scheduler implementation adds time to the last_exec_time. A new scheduler which
does not use this value will be implemented. So this will be fixed at a bit later date.
[16 Feb 2006 21:09] Andrey Hristov
This should be closed when bug #17494 is fixed.
[13 Apr 2006 21:53] Andrey Hristov
I think this is fixed, it but someone who is not me should retest it and probably close
it.
[13 Apr 2006 22:22] Miguel Solorzano
Thank you for the bug report. I was unable to repeat anymore with
current source server:

mysql> select * from information_schema.events\G
*************************** 1. row ***************************
 EVENT_CATALOG: NULL
  EVENT_SCHEMA: test
    EVENT_NAME: insertIntoTt
       DEFINER: root@localhost
    EVENT_BODY: BEGIN
 INSERT INTO test.tt (d) VALUES (floor(rand() * 20));
END
    EVENT_TYPE: RECURRING
    EXECUTE_AT: NULL
INTERVAL_VALUE: 5
INTERVAL_FIELD: SECOND
      SQL_MODE:
        STARTS: 2006-04-13 21:23:19
          ENDS: NULL
        STATUS: ENABLED
 ON_COMPLETION: NOT PRESERVE
       CREATED: 2006-04-13 17:23:14
  LAST_ALTERED: 2006-04-13 17:23:14
 LAST_EXECUTED: 2006-04-13 21:23:30
 EVENT_COMMENT:
1 row in set (0.01 sec)

mysql> select version();
+-------------------+
| version()         |
+-------------------+
| 5.1.10-beta-debug |
+-------------------+
1 row in set (0.00 sec)