Bug #56020 Restore of dump failed
Submitted: 16 Aug 2010 15:48 Modified: 1 Sep 2010 10:49
Reporter: Byron Palmer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.26 OS:Windows (XP)
Assigned to: Alexander Musienko CPU Architecture:Any

[16 Aug 2010 15:48] Byron Palmer
Description:
I was attempting to restore a backup of selected tables. Error description was

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

    logmsg = "Restoring %s (%s)" % (schema, table)

NameError: global name 'schema' is not defined

How to repeat:
Dump a few tables.

Attempt to reload using the administrative tool.

You can reload them using the sql editor, but for large tables this will not work. You can also reload them using a text connection.

Suggested fix:
Figure out why the variable schema is not defined and fix.
[17 Aug 2010 15:24] Johannes Taxacher
Hi Byron,

did you create the dump you tried to restore with Workbenchs bacup/dump feature in admin section or was the dump created with mysqldump directly?
thanks in advance
[17 Aug 2010 15:35] Byron Palmer
I opened up the administrator on my production server and backed up a dozen tables.

I then opened up the administrator on a different server pointing to my test instance and attempted to restore the backup. My purpose was to copy over data that I was testing that existed in production. I wanted to make sure I had the latest information for testing.

The restore failed. So I opened up a query window and read each backup file and ran it and all was restored. It seems that there is some variable that is not getting initialized properly. I looked through the setup and couldn't see what it was. The servers are Windows servers which I have installed ssh on for administrative purposes. It does not work all the time though as Windows does not always behave properly.
[24 Aug 2010 20:00] Sveta Smirnova
Thank you for the report.

Verified as described.
[30 Aug 2010 15:10] Alfredo Kojima
marked bug #55920 as duplicate
[30 Aug 2010 18:31] Johannes Taxacher
fix confirmed in repository
[1 Sep 2010 10:49] Tony Bedford
An entry has been added to the 5.2.27 changelog:

While attempting to restore a backup of selected tables, the following error was generated:

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

    logmsg = "Restoring %s (%s)" % (schema, table)

NameError: global name 'schema' is not defined