Bug #12853 MQB generates invalid comments running Edit All Stored Procedure/Functions
Submitted: 29 Aug 2005 17:41 Modified: 20 Sep 2005 11:08
Reporter: Anders Karlsson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.14 OS:Windows (Windows XP)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[29 Aug 2005 17:41] Anders Karlsson
Description:
When using MySQL Query Browser and choosing "Script->Edit All Stored Procedures Functions" a script which will cretae all stored procedures and functions is prepared. The script contains embedded line separators with "double slash" leading the line. This seemed to be a valid comment in earlier versions of MQB (I tested in 1.1.13, and that did not work. The version before that that I have was 1.1.7, and there any lines beginning with a double slash were silently ignored). As the double dash is no longer an accepted comment introducer, MQB generates code that is invalid.

How to repeat:
- Start MQB.
- Choose a non-existing database and let MQB create one for you when it asks you.
- Choose Script->Create Stored Procedure / Function in the menu.
- Name the procedure p1 and click on "Create PROCEDURE".
- When the template code is generated, click the "Execute" button.
- In the menu, choose Script->Edit All Stored Procedure / Function.
- A script is generated that looks like this:
DELIMITER $$

// -----------------------------------------------------------------------------

DROP PROCEDURE IF EXISTS `test4`.`p1`$$
CREATE PROCEDURE `p1`()
BEGIN

END$$

// -----------------------------------------------------------------------------

DELIMITER ;
- To execute this script, click the "Execute" button again.
- Error messages are produced for the two "separator" lines, and also for the
"CREATE PROCEDURE" statement, as the separator lines isn't terminated, this goes on into the DROP PROCEDURE statement, which hence gets invalid and is ignored.

Suggested fix:
Three options:
- Do not produce the separator line.
- Make the separator line configurable and optional.
- Reintroduce // as a valid comment introducer.

The last of these is not a good one, as the double slash is a commonly used as delimiter.
[20 Sep 2005 11:08] Vladimir Kolesnikov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html