Bug #56871 Reverse Engineering doesn't restore routines
Submitted: 20 Sep 2010 13:18 Modified: 13 Dec 2010 0:21
Reporter: Arsen Shnurkov Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.27, 5.2.28 OS:Linux (Gentoo)
Assigned to: CPU Architecture:Any
Tags: PROCEDURE, stored proc

[20 Sep 2010 13:18] Arsen Shnurkov
Description:
Reverse engineering doesn't restore stored procedures.

How to repeat:
Create a database with stored procedures (MySQL server dev-db/mysql-5.5.1_alpha_pre2).
Reverse engeneer it.
On the "physical schemata" panel there is no items in the "Routines" list.
[23 Sep 2010 11:39] Johannes Taxacher
Hi Arsen,
does this happen with all procedures you tried so far (i cannot reproduce this problem).
could you maybe attach one of the troublesome procedures for us to reproduce the issue?

thanks in advance
[24 Sep 2010 18:09] Arsen Shnurkov
Screenshot of missed stored procs (workbench v5.2.28)

Attachment: sp.png (image/png, text), 280.60 KiB.

[24 Sep 2010 18:13] Arsen Shnurkov
> does this happen with all procedures you tried so far.

yes.

> could you maybe attach one of the troublesome procedures 
> for us to reproduce the issue?

DROP TABLE IF EXISTS users;
create table users
(
us_id INTEGER NOT NULL AUTO_INCREMENT, CONSTRAINT pk_users UNIQUE INDEX (us_id),
us_username varchar(40) not null, CONSTRAINT unique_us_username UNIQUE INDEX (us_username),
us_salt INTEGER null,
us_password varchar(64) not null,
us_firstname varchar(60) null,
us_lastname varchar(60) null
# ... some more fields
) TYPE=InnoDB ;

DROP PROCEDURE IF EXISTS GetUsernameByID;
CREATE PROCEDURE GetUsernameByID (IN par_us_id INTEGER, OUT result varchar (40))
BEGIN
	select us_username INTO result from users where us_id = par_us_id;
END;
[26 Sep 2010 13:08] Valeriy Kravchuk
Please, check if this happens with a newer version of server, 5.5.5 at least.
[26 Sep 2010 15:45] Arsen Shnurkov
There is no ebuild for 5.5.5:
http://gpo.zugaina.org/dev-db/mysql

Latest available version is 5.5.4
http://git.overlays.gentoo.org/gitweb/?p=proj/mysql.git;a=tree;f=dev-db/mysql;h=6f52fc5dec...

The official latest version is "Current Generally Available Release: 5.1.51"

It would be nice to have -5.5.5 or -9999 ebuild.
[26 Sep 2010 15:50] Arsen Shnurkov
MySQL 5.5.5 ebuild request:
http://bugs.gentoo.org/show_bug.cgi?id=338818
[27 Sep 2010 23:24] Arsen Shnurkov
Retested with mysql-5.5.6-rc, nothing changes
[28 Oct 2010 22:09] Alfredo Kojima
Connect to your server, and then type the following:
SHOW FUNCTION STATUS;
SHOW PROCEDURE STATUS;
select ROUTINE_NAME from information_schema.routines where ROUTINE_SCHEMA = 'yourdbname';

Do all these commands show your routines? Would it be possible for you to attach a dump of your database, including the routines? You can skip the data, we only need the structure.
[11 Nov 2010 9:30] Arsen Shnurkov
mysql> SHOW FUNCTION STATUS;
Empty set (0.00 sec)

mysql> SHOW PROCEDURE STATUS;
+-------+------------------------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db    | Name                               | Type      | Definer        | Modified            | Created             | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+-------+------------------------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| banks | DeleteBugPostByID                  | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | GetBugPostContentByID              | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | GetBugPostFilenameByID             | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | GetBugsCount                       | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | GetBugShortDescByID                | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | GetProjectDefaultUserByProjectID   | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | GetProjectWithCustomDropdownsCount | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | GetQueryByID                       | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | GetUsernameByID                    | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | InsertBugPost                      | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | InsertBugPostAttachment            | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | InsertBugPostComment               | PROCEDURE | root@localhost | 2010-09-20 22:23:41 | 2010-09-20 22:23:41 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | InsertOrUpdate_Banks               | PROCEDURE | root@localhost | 2010-08-28 15:20:16 | 2010-09-20 07:48:34 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | InsertOrUpdate_Banks_Or_Sites      | PROCEDURE | root@localhost | 2010-08-28 15:20:16 | 2010-09-20 07:48:34 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
| banks | InsertOrUpdate_Sites               | PROCEDURE | root@localhost | 2010-08-28 15:20:16 | 2010-09-20 07:48:34 | DEFINER       |         | utf8                 | utf8_general_ci      | utf8_general_ci    |
+-------+------------------------------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
15 rows in set (0.00 sec)

select ROUTINE_NAME from information_schema.routines where ROUTINE_SCHEMA = 'banks';
+------------------------------------+
| ROUTINE_NAME                       |
+------------------------------------+
| DeleteBugPostByID                  |
| GetBugPostContentByID              |
| GetBugPostFilenameByID             |
| GetBugsCount                       |
| GetBugShortDescByID                |
| GetProjectDefaultUserByProjectID   |
| GetProjectWithCustomDropdownsCount |
| GetQueryByID                       |
| GetUsernameByID                    |
| InsertBugPost                      |
| InsertBugPostAttachment            |
| InsertBugPostComment               |
| InsertOrUpdate_Banks               |
| InsertOrUpdate_Banks_Or_Sites      |
| InsertOrUpdate_Sites               |
+------------------------------------+
[13 Nov 2010 0:21] Alfredo Kojima
Please try repeating your problem with the sakila DB, from http://dev.mysql.com/doc/index-other.html  
I tried that here with MySQL 5.5.7 and it worked ok.
If reveng of routines doesn't work for you with sakila either, then try with MySQL 5.5.7 and if the problem persists. If it does work for sakila, then please attach the schema for your DB to this bug so we can see exactly what from it is causing the problem.
[14 Dec 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".