Bug #16427 Events: Crash if double call of procedure which creates event
Submitted: 12 Jan 2006 4:23 Modified: 8 Mar 2006 11:58
Reporter: Peter Gulutzan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.1.6-alpha-debug OS:Linux (linux)
Assigned to: Assigned Account CPU Architecture:Any

[12 Jan 2006 4:23] Peter Gulutzan
Description:
I execute certain statements, including CREATE PROCEDURE
... CREATE EVENT. I call that procedure twice. Crash.

How to repeat:

mysql> create procedure p_38 () create event e_38 on schedule every 1 second do set @a = 5;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from mysql.event;
Empty set (0.00 sec)

mysql> call p_38();
Query OK, 0 rows affected (0.00 sec)

mysql> select * from mysql.event;
+-----+------+-------------+----------------+------------+----------------+----------------+---------------------+---------------------+---------------+--------+------+---------+---------------+---------+
| db  | name | body        | definer        | execute_at | interval_value | interval_field | created             | modified            | last_executed | starts | ends | status  | on_completion | comment |
+-----+------+-------------+----------------+------------+----------------+----------------+---------------------+---------------------+---------------+--------+------+---------+---------------+---------+
| db1 | e_38 |  set @a = 5 | root@localhost | NULL       |              1 | SECOND         | 2006-01-11 19:21:48 | 2006-01-11 19:21:48 | NULL          | NULL   | NULL | ENABLED | DROP          |         |
+-----+------+-------------+----------------+------------+----------------+----------------+---------------------+---------------------+---------------+--------+------+---------+---------------+---------+
1 row in set (0.00 sec)

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

mysql> call p_38();
ERROR 2013 (HY000): Lost connection to MySQL server during query
[12 Jan 2006 7:24] Aleksey Kishkin
stacktrace :

0x80cc2ec handle_segfault + 680
0x825f6ea __pthread_sighandler + 122
0x80e9344 _Z21mysql_execute_commandP3THD + 31182
0x81d51f5 _ZN13sp_instr_stmt9exec_coreEP3THDPj + 17
0x81d4f26 _ZN13sp_lex_keeper23reset_lex_and_exec_coreEP3THDPjbP8sp_instr + 186
0x81d50e7 _ZN13sp_instr_stmt7executeEP3THDPj + 217
0x81d2849 _ZN7sp_head7executeEP3THD + 845
0x81d36c6 _ZN7sp_head17execute_procedureEP3THDP4ListI4ItemE + 998
0x80e74da _Z21mysql_execute_commandP3THD + 23396
0x80eaaf7 _Z11mysql_parseP3THDPcj + 409
0x80e0354 _Z16dispatch_command19enum_server_commandP3THDPcj + 1152
0x80dfe88 _Z10do_commandP3THD + 154
0x80df219 handle_one_connection + 449
0x825b7b1 pthread_start_thread + 225
0x828a25a clone + 106
[8 Mar 2006 11:55] Andrey Hristov
This seems to be a dupe of #16408
[8 Mar 2006 11:58] Andrey Hristov
set global does not matter, it's #16408