Bug #65154 Unable to alter function
Submitted: 30 Apr 2012 10:33 Modified: 4 Jul 2012 21:53
Reporter: charl retief Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.38, 5.2.39 OS:Any (Ubuntu 11.04, Mac OS X)
Assigned to: CPU Architecture:Any

[30 Apr 2012 10:33] charl retief
Description:
When you have a stored procedure and stored function with the exact same name then it is not possible open the function with the "alter routine..." window.
Whenever you attempt to alter the function the the create code for the procedure is shown.

How to repeat:
1) Run this sql to create a procedure and function with the same name:

DELIMITER $$

CREATE PROCEDURE `test123` ()
BEGIN
    SELECT "I am a stored routine";
END$$

CREATE FUNCTION `test123` () RETURNS VARCHAR(100)
BEGIN
    RETURN "I am a stored function";
END$$

2) It can be verified that the correct sql for both routines was saved by running:
SHOW CREATE FUNCTION `test123`;
SHOW CREATE PROCEDURE `test123`;

3) Refresh the database treeview on the left of WB
4) Expend the routines section
5) now try to right click and "alter routine..." on the function
[The create code for the procedure is shown instead of the function]

PS.: functions is not alphabetical sorted in the list of "routines", they appear in the bottom of the list.

Suggested fix:
I have already (about 2 years ago) logged a feature request to split the stored procedures and functions into 2 separate categories. Such a logical split should also eliminate sorting issues and the "alter routine..." issues.

See my other feature request here:
See bug #56368.
[30 Apr 2012 12:37] Valeriy Kravchuk
Thank you for the bug report.
[4 Jul 2012 21:53] Alfredo Kojima
This is a duplicate of a bug fixed in 5.2.41