Bug #50609 Import failing when there are spaces in the dump file path
Submitted: 25 Jan 2010 23:59 Modified: 9 Feb 2010 11:22
Reporter: Cleon Pinto Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S3 (Non-critical)
Version:5.2.14 OS:Windows (Windows 7 (64 bit))
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: dump, import, windows

[25 Jan 2010 23:59] Cleon Pinto
Description:
The script that is used to import a data dump doesn't take into account spaces in the path to the dump file.

It produces a command like:
mysql.exe --defaults-extra-file=c:\users\user\appdata\local\temp\tmpdymruk  --host=127.0.0.1 --user=root --port=3306 --comments<  C:\Path with spaces\Dump20100126\table_dump.sql

missing the double quotes and failing the call.

How to repeat:
Export a dump of a table to a file with spaces in its path.
drop the table
try to import restore the table with the dumped file.

Suggested fix:
Work around:

1) edit \MySQL\MySQL Workbench 5.2 OSS\modules\wb_admin_export.py

2) change line 495 from:

            params.append([lambda s,t : None , filename,[[True,""]]])

to:
            params.append([lambda s,t : None , "\"" + filename + "\"",[[True,""]]])

3) delete wb_admin_export.pyc

4) restart Workbench
[26 Jan 2010 0:08] Cleon Pinto
changed to Severity to S3 (non-critical)
[26 Jan 2010 13:45] MySQL Verification Team
Thank you for the bug report.
[28 Jan 2010 22:39] Alfredo Kojima
Marked bug #50007 as duplicate of this one
[29 Jan 2010 3:08] Barry Galbraith
Your suggested fix adds quotes to the file name, but the \ still needs to be either escaped \\ or changed to /.
[29 Jan 2010 4:35] Barry Galbraith
I replaced \ with \\ with regexp and still no import.
A temp file containing the mysql password has been introduced, referred to as --defaults-extra-file=  The path for that file also needs \ escaping as \\.
[29 Jan 2010 9:35] Barry Galbraith
Even with the command line "fixed", there is still no import.
mysql.exe is NOT called, ever.
The logstr output shows the first of many files successfully imported, but no import happens.
[30 Jan 2010 3:35] Alfredo Kojima
Fixed by quoting the filename to be imported
[1 Feb 2010 14:44] Johannes Taxacher
fix confirmed. will be included in 5.2.16
[9 Feb 2010 11:22] Tony Bedford
An entry has been added to the 5.2.16 changelog:

In the Data Dump facility of the Administrator it was not possible to import a file where the path contained a space.