Bug #23850 Stored Procedure - No Name crashes MySQL
Submitted: 1 Nov 2006 18:26 Modified: 3 Dec 2006 14:09
Reporter: Marc Taillieu Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:MySQL 5.0.18-nt OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[1 Nov 2006 18:26] Marc Taillieu
Description:
I was working with a stored procedure, and to avoid destroying the original I created a test procedure.  This time I DID NOT enter a name for the stored procedure, and forgot to do so after I was finished writing it.  I was able to save the procedure, but this kills the MySQL service, and requires it to be restarted to continue.  Anytime I try to access the stored procedure the MySQL service crashes.  This has crippled my database and access to anyother database on my server.  My Visual studio Just intime debugger pops up when I try to access it and displays the following error message: 'An unhandled win32 exception occurred in mysqld-nt.exe [1988].'.  Then I stepped into the debugger and received the following error message: 'Unhandled exception at 0x004ee740 in mysqld-nt.exe: 0xC0000005 Access violation reading location 0x00000000.' The mySQL error reads: 'Lost connection to MySQL server during query' Error number 2013.

How to repeat:
How to Repeat

Create a stored procedure with MySQL Administrator.
Do not enter a name for the stored procedure when prompted to
Write a simple stored procedure, mine was took in 3 parms and used an if, ifelse, else to choose between 3 select statements.
Save the stored procedure

Result

Stored Procedure should appear to be added to the database
stored procedures list will not refresh
Can not connect to MySQL database, connection lost, service killed
Can ping server
Restart service
Open re-connect to MySQL Admin
view Stored procedures list
stored procedures list will not refresh
Can not connect to MySQL database, connection lost, service killed
Can ping server
Restart service
Connect to MySQL Query Browser, connect to information_schema database
Execute 'SELECT * FROM information_schema.ROUTINES R;'
Can not connect to MySQL database, connection lost, service killed
Can ping server
Restart service
Connect to MySQL Query Browser, connect to mySQL database
Execute 'SELECT * FROM mysql.proc p;'
Edit the table
Delete the row containing the stored procedure with no name
Apply the changes
Open mySQL adminsitrator
Open the database that contained the problem
View the stored procedures list
Everything is now ok

Suggested fix:
Do not allow stored procedures, functions, triggers to be saved without a name.
Its good I don't have to add a name in that popup that prompts me to because sometimes I copy and paste an old procedure I created
[2 Nov 2006 9:19] Valeriy Kravchuk
What exect version of MySQL server do you use? Try to repeat with the latest, 5.0.27, and inform about the results.
[3 Nov 2006 14:09] Valeriy Kravchuk
Please, inform about the results with 5.0.27 when you'll have a chance to try this version.
[4 Dec 2006 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".