Can't view contents of stored procedure

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
gwolfe
Posts: 4
Joined: Thu 18 Jun 2009 14:38

Can't view contents of stored procedure

Post by gwolfe » Thu 18 Jun 2009 14:46

Whenever I try to open any of the stored procedures defined by one particular user for editing, I get the following error message:

Cannot obtain the SQL code for an object '[ProcedureName]'. Probably, you do not have enough privileges to get object metadata.

This happens no matter what user I'm connected as, including the procedure definer and the root user.

Any thoughts?

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Fri 19 Jun 2009 08:01

Hello.

Could you please perform some tests?

Execute the following queries in dbForge Studio for MySql and send us the result. Substitute your_database_name, your_procedure_name before execute.

SHOW CREATE PROCEDURE your_database.your_procedure_name;

SELECT
*
FROM
mysql.proc
WHERE
`name` = 'your_procedure_name';

SELECT
*
FROM
information_schema.routines
WHERE
ROUTINE_NAME = 'your_procedure_name';

gwolfe
Posts: 4
Joined: Thu 18 Jun 2009 14:38

Post by gwolfe » Fri 19 Jun 2009 18:03

I tried the three queries you suggested, and each one returned the appropriate row for the procedure, including the actual code. But when I try to open the procedure through the editor, I get the same error message.

gwolfe
Posts: 4
Joined: Thu 18 Jun 2009 14:38

Post by gwolfe » Fri 19 Jun 2009 20:13

I've figured out how to recreate this problem, and from what I can tell it seems to occur when a procedure has multiple "ALTER TABLE" commands in it. Here are the steps to recreate the error:
(note: I'm using version 3.50.275)
  • 1. Create a new stored procedure.

    2. Paste the following code in the body of the procedure:

    Code: Select all

      ALTER TABLE test.t1
        ADD COLUMN col3 INT;
    3. Click 'Compile'. It will compile properly; if you close the editor window you will be able to re-open and edit the procedure.

    4. Add a second "ALTER TABLE" statement to the body of the procedure:

    Code: Select all

    ALTER TABLE test.t1
        ADD COLUMN col3 INT;
    
      ALTER TABLE test.t1
        ADD COLUMN col4 INT;
    5. Click compile.
At this point, I get this error message:
Cannot obtain the SQL code for an object 'procedure1'. Probably, you do not have enough privileges to get object metadata.

After closing the editor window, the procedure shows up in the database explorer, you can execute it, and it shows up if you do "SHOW CREATE PROCEDURE test.procedure1". However, when you try to open it for editing, you get the same error message.

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Mon 22 Jun 2009 10:30

Thank you very much for assistance! We have reproduced and fixed the bug. The fix will be available in the next build in a few days.

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Tue 23 Jun 2009 12:58

The new build 3.50.305 of dbForge Studio for MySQL is available.

gwolfe
Posts: 4
Joined: Thu 18 Jun 2009 14:38

Post by gwolfe » Tue 23 Jun 2009 17:19

Hi again,

Thanks for dealing with my bug report so quickly. However, I don't know if the issue is fully resolved yet.

I installed 3.50.305, and it works properly with the simple example I posted before. However, when I try to open one of the stored procedures that was originally giving me problems, I get a different error message:
dbForge Studio for MySQL has encountered an unexpected error.
It asks if I want to submit an error report, which I just did.

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Wed 24 Jun 2009 07:14

Hello,

We have recieved the error report. Sorry for inconvenience. After fixing your request we performed some tests but did not find any other problems. We decided to raise an error report insted of message box in case of parse error to simplify feedback.

Could you send us a procedure sample to reproduce the bug please? You can paste it to the error report.

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Fri 26 Jun 2009 07:16

Hello. The build with bug fix is available on the site

Post Reply