Bug #30920 In Administrator, stored procedures are corrupted or deleted after an error
Submitted: 9 Sep 2007 1:21 Modified: 10 Feb 2009 10:16
Reporter: Gabriel Lawrence Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S2 (Serious)
Version:1.2.12 OS:Windows (XP Professional)
Assigned to: Mike Lischke CPU Architecture:Any

[9 Sep 2007 1:21] Gabriel Lawrence
Description:
In Administrator, while editing a procedure, if an error is genereted after clicking the Execute SQL button, some of the code will be deleted if the SQL Editor window is closed.  Furthermore, if the SQL Editor window is left open and the Administrator is closed, the procedure will be dropped!!

How to repeat:
Start Administrator
Edit a good procedure (one already created and saved)
Change the code to generate an error (remove a semi-colon for example)
Click "Execute SQL" and generate an error
Close error window (either with the 'X' or with the Cancel button...doesn't matter which one)
Edit stored procedure again and some of the original code gone.

Suggested fix:
Obviously, the error shouldn't affect the code that's already saved.  If I make a change in code and an error results, I should be able to leave the edit window without needing to correct the error.  Either revert the code back to it's original "good" format on exit, or leave the "bad" code in place and show the procedure as disabled or unusable until it's fixed.  Perhaps give the user the option on exit "Would you like to revert back to good code or disable the procedure and leave the bad code" (the wording could be better summarized)  ;-)
[9 Sep 2007 3:04] Valeriy Kravchuk
Thank you for a bug report. Verified just as described.
[10 Feb 2009 10:16] Mike Lischke
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/