Bug #15275 Crashes when creating procedures/triggers when not in a database
Submitted: 27 Nov 2005 15:38 Modified: 27 Nov 2005 15:51
Reporter: Karthik Viswanathan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.15-nt-max OS:Windows (Windows XP (NT 5.1))
Assigned to: CPU Architecture:Any

[27 Nov 2005 15:38] Karthik Viswanathan
Description:
Server crashes when not creating triggers / procedures in a database (using: use databasename)

How to repeat:
How to crash MySQL (tested on max-nt)
-------------------------------------

1. Login using user/pass (not into a database!)

mysql -u root -p 
Password: ******

2. Execute either of these (dummy procedure/trigger :-)

-------------------- Case 1 Crash -----------------------

delimiter //
CREATE PROCEDURE test() BEGIN SELECT VERSION(); END //

---------------------------------------------------------

-------------------- Case 2 Crash -----------------------

CREATE TRIGGER testref BEFORE INSERT ON mysql.User FOR EACH ROW BEGIN END;

---------------------------------------------------------

Suggested fix:
Make it like it gives an error for tables/views:

no database selected
[27 Nov 2005 15:51] Valeriy Kravchuk
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

Duplicate of http://bugs.mysql.com/bug.php?id=14434, http://bugs.mysql.com/bug.php?id=14248, and/or, really, http://bugs.mysql.com/bug.php?id=14569. So, please, check with 5.0.16 now available and, if problem still appears, wait for 5.0.17.