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.