Page 1 of 1

Can't view contents of stored procedure

Posted: Thu 18 Jun 2009 14:46
by gwolfe
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?

Posted: Fri 19 Jun 2009 08:01
by Elias
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';

Posted: Fri 19 Jun 2009 18:03
by gwolfe
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.

Posted: Fri 19 Jun 2009 20:13
by gwolfe
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.

Posted: Mon 22 Jun 2009 10:30
by Elias
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.

Posted: Tue 23 Jun 2009 12:58
by Elias
The new build 3.50.305 of dbForge Studio for MySQL is available.

Posted: Tue 23 Jun 2009 17:19
by gwolfe
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.

Posted: Wed 24 Jun 2009 07:14
by Elias
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.

Posted: Fri 26 Jun 2009 07:16
by Elias
Hello. The build with bug fix is available on the site