Bug #13626 Creating a store proc crashes the server if no db is selected
Submitted: 29 Sep 2005 23:30 Modified: 29 Sep 2005 23:32
Reporter: jocelyn fournier (Silver Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.14-rc OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[29 Sep 2005 23:30] jocelyn fournier
Description:
Hi,

When trying to create a store proc without selecting a db, MySQL crashes.
If a db is selected before, all works OK.

Regards,
  Jocelyn

How to repeat:
delimiter //
CREATE PROCEDURE simpleproc (OUT param1 INT) BEGIN SELECT COUNT(*) INTO param1 FROM t1; 
END//

ERROR 2013 (HY000): Lost connection to MySQL server during query

use mysql
CREATE PROCEDURE simpleproc (OUT param1 INT) BEGIN SELECT COUNT(*) INTO param1 FROM t1; 
END//
Query OK, 0 rows affected (0.00 sec)

Stack trace :

0x814d7cc handle_segfault + 356
0x4004f825 _end + 934398613
0x836fe56 my_strcasecmp_utf8 + 30
0x8165211 mysql_execute_command(THD*) + 17613
0x8167c22 mysql_parse(THD*, char*, unsigned int) + 294
0x815f82e dispatch_command(enum_server_command, THD*, char*, unsigned int) + 1186
0x815f351 do_command(THD*) + 129
0x815e84e handle_one_connection + 550
0x40049e51 _end + 934375617
0x401d06ea _end + 935975258
[29 Sep 2005 23:32] jocelyn fournier
Duplicate of bug #13514 :)