Bug #60354 Workbench can't open a stored procedure
Submitted: 5 Mar 2011 15:41 Modified: 16 May 2011 19:15
Reporter: Ivan Cachicatari Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.33 OS:Any (Mac OS X, Ubuntu 10.10)
Assigned to: CPU Architecture:Any

[5 Mar 2011 15:41] Ivan Cachicatari
Description:
When I try to open a stored procedure from objects tree: nothing happen.

I start mysql-workbench from command line to see the messages:

** (mysql-workbench-bin:3381): WARNING **: Object name ProcedureName was not found in catalog, trying to search it as procedurename

** (mysql-workbench-bin:3381): WARNING **: Object name procedurename was not found in catalog.

I have selected the database with stored procedures.

How to repeat:
1. Open SQL Editor
2. Select de database
3. Right-click to stored procedure and select "Alter routine..."
[5 Mar 2011 16:30] Valeriy Kravchuk
What version of MySQL server, x.y.z, are you working with? What is the name of procedure you see in Workbench?
[5 Mar 2011 16:34] Ivan Cachicatari
mysql> select @@version;
+-----------------+
| @@version       |
+-----------------+
| 5.1.49-1ubuntu8 |
+-----------------+
1 row in set (0.00 sec)

Some function names is:
getConfigFromId
getStringFromId
getEngineFromId
getLatestId

Some stored names is:

sp_generate_config
sp_generate_string

etc...
[5 Mar 2011 21:13] MySQL Verification Team
Could you please try version 5.2.32. Thanks in advance.
[5 Mar 2011 22:38] Ivan Cachicatari
I just download and install the new Workbench version 5.2.32 but the error persists, this is a message output from command-line execution.

** (mysql-workbench-bin:5693): WARNING **: Object name getBaseID was not found in catalog, trying to search it as getbaseid

** (mysql-workbench-bin:5693): WARNING **: Object name getBaseID was not found in catalog.

Thanks for your helping.
[9 Mar 2011 7:52] Valeriy Kravchuk
Please, send the results of:

show variables like 'lower%';

from your server.
[9 Mar 2011 9:23] Ivan Cachicatari
Ok, this is the results:

mysql> show variables like 'lower%';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_file_system | OFF   |
| lower_case_table_names | 0     |
+------------------------+-------+
2 rows in set (0.15 sec)
[15 Mar 2011 9:56] Valeriy Kravchuk
I still can not repeat this crash with 5.2.33. Ubuntu 10.04, same settings for 'lower%' variables, MySQL server 5.1.41 that comes with Ubuntu - no problems to open functions with names like yours.

Please, give 5.2.33 a try and inform about the results.
[17 Mar 2011 2:47] Ivan Cachicatari
I found the source problem, follow these steps:

1. Goto Edit -> Preferences -> Sql Editor Tab
2. Change the SQL delimiter to semicolon ';'  (defaut is $$)
3. Save the new preference.
4. Select a database
5. Right-click to stored procedure and select "Alter routine..."
6. You will see the bug.

Regards.
[17 Mar 2011 17:35] Valeriy Kravchuk
Verified as described in the last comment. On Mac OS X I've got (when started from the command line):

...
2011-03-17 19:31:58.362 MySQLWorkbench[20361:10b] restore edit menu

** (process:20361): WARNING **: Object name get_myDate was not found in catalog, trying to search it as get_mydate

** (process:20361): WARNING **: Object name get_myDate was not found in catalog.

But we have a perfect workaround here: do NOT set delimiter to ;
[14 Apr 2011 22:06] Alfredo Kojima
Hi

Why did you change the delimiter value to ;  ?
[14 Apr 2011 22:33] Alfredo Kojima
; should not be used in that option, the option is mislabeled and should actually read something like "Non Standard SQL Delimiter". It should be set to a value that's different from the usual delimiter, as it's used to separate stored procedures (which contain ; in their bodies) from one another.
[15 Apr 2011 7:00] Ivan Cachicatari
Alfredo Kojima, 

Yes, but maybe the MySQL Workbench should not accept the ; as a a separator.
[16 May 2011 19:15] Paul Dubois
Noted in 5.2.34 changelog.

Stored procedures could not be opened from the objects tree if the
SQL Delimiter had been changed to the ';' character. Now the label
for this option in the Preferences dialog has been changed to Non
Standard SQL Delimiter to better reflect its actual meaning. The 
tooltip has also been changed to be more descriptive. In addition, if
an Alter <object>... operation fails due to a parse error, the
retrieved DDL code is shown as is in the SQL editor.