Bug #63653 Export does not work for the database with SP having parameter
Submitted: 7 Dec 2011 17:42 Modified: 23 Dec 2011 17:49
Reporter: Valeriy Kravchuk Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:5.2.36 OS:Any (Mac OS X, Windows x64)
Assigned to: CPU Architecture:Any

[7 Dec 2011 17:42] Valeriy Kravchuk
Description:
Whenever one tries to export database with stored procedure having parameter, like this:

mysql> create procedure p1(c1 int) select 1;
Query OK, 0 rows affected (0.12 sec)

he gets unhandled exception:

"Unhandled exception: local variable 'params' referenced before assignment"

and export fails.

How to repeat:
1. Create test database (on server versions 5.1.60, or 5.5.18)
2. Create procedure with one parameter in it
3. Try to export database in Workbench 5.2.36 with the following options set:

- export into single file
- create dump in single transaction
- dump stored procedures and views
- dump events

Suggested fix:
Change code. Check for possible regressions carefully before release.
[8 Dec 2011 12:08] Sergio Andres De La Cruz Rodriguez
I have not been able to reproduce this bug in workbench development version with MySQL v5.5.15 in Ubuntu Linux 11.04.

These are the steps I followed:

 - Executed "create procedure test.p1(c1 int) select 1;" using the CLI in a local MySQL server.
 - Opened the server instance in WB.
 - Went to "Data Export" page and selected the test database with the options specified by the OP.

The export process finishes successfully.
[9 Dec 2011 2:33] jake haldeman
It happens to me also running on Windows 2003 Server (32bit) I'm trying to export a ShoreTel/Shoreware database and get the error.

I Export to a Self-Contained File, create in a single transaction, dump stored routines and dump events (all of those are checked).  When I click start it gives the error "Unhandled exception: local variable 'params' referenced before assignment" I click OK and bring up the Output window to see this:

Traceback (most recent call last):

  File "D:\Program Files\MySQL\MySQL Workbench 5.2 CE\modules\wb_admin_export.py", line 1592, in start

    params.append("--routines")

UnboundLocalError: local variable 'params' referenced before assignment
[23 Dec 2011 17:49] Philip Olson
Fixed as of 5.2.37:

Exporting a database that has a stored procedure, resulted in an
unhandled exception.
[2 Feb 2012 19:20] Philip Olson
For Mac OS X: fixed as of 5.2.38