Bug #16522 Events: Event occurs after ENDS time, or isn't dropped, or crash
Submitted: 15 Jan 2006 22:16 Modified: 26 May 2006 13:27
Reporter: Peter Gulutzan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.1.6-alpha-debug OS:Linux (SUSE 10.0)
Assigned to: Andrey Hristov CPU Architecture:Any

[15 Jan 2006 22:16] Peter Gulutzan
Description:
I make an event which has an ENDS time.
The ENDS time, due to the way I've
defined it, will happen before the
first possible execution time. But:
the event is executed once anyway,
or the event is not executed but it
is not dropped, or there's a crash.
Whichever outcome you see, it's a bug.

How to repeat:
Assume a database named db1.

mysql> set global event_scheduler = 1;
Query OK, 0 rows affected (0.00 sec)

mysql> create table t (s1 timestamp);
Query OK, 0 rows affected (0.00 sec)

mysql> create event e_63 on schedule every 2 second
    -> ends current_timestamp do
    -> insert into db1.t values (current_timestamp);
Query OK, 1 row affected (0.00 sec)

mysql> select count(*) from t;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from mysql.event where name='e_63';
ERROR 2006 (HY000): MySQL server has gone away
[16 Jan 2006 11:06] Miguel Solorzano
030416  9:06:02 [Note] Event found disabled, dropping.
*** glibc detected *** free(): invalid next size (fast): 0x091e2ef0 ***
mysqld got signal 6;
[9 Mar 2006 13:33] Jon Stephens
Updated Events documentation regarding timings per discussion with Andrey and PeterG. Left bug status as Verified.
[18 Apr 2006 19:00] Andrey Hristov
Should be retested after bug #17619 is closed.
[26 May 2006 13:27] Miguel Solorzano
I was unable to repeat with current source server with an error
in the create event:

miguel@hegel:~/dbs/5.1> bin/mysql -uroot db1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.1.12-beta-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set global event_scheduler = 1;
Query OK, 0 rows affected (0.00 sec)

mysql> create table t (s1 timestamp);
Query OK, 0 rows affected (0.01 sec)

mysql> create event e_63 on schedule every 2 second
    -> ends current_timestamp do
    -> insert into db1.t values (current_timestamp);
ERROR 1530 (HY000): ENDS is either invalid or before STARTS
mysql>