Bug #58377 Export as "SQL Insert Statements" file does not work properly
Submitted: 22 Nov 2010 11:07 Modified: 6 Jan 2011 14:27
Reporter: Jan T. Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.30 OS:Any (Fedora 14 x86_64, Windows XP)
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: export sql file editor

[22 Nov 2010 11:07] Jan T.
Description:
I exported a result as a "SQL Insert Statements" file and here are some points I have noticed:

1.
The first line contains the executed select statements as a comment but the "LIMIT" syntax is dropped in a new line - so the "LIMIT" is not commented
=> will result in error when executing the statement(s)

2.
Strings after the "VALUES" keyword are not quoted 
=> will result in error when executing the statement(s)

3.
The "INSERT" statement(s) does not contain the name of the exported table - simply the string "'table'" ("INSERT INTO 'table'").

4.
Existing files are overwritten without confirmation

How to repeat:
- Select "Rows" from a table
- Click "Export recordset to an external file"
- Choose "SQL Insert Statements" as "File Format"
[22 Nov 2010 11:15] Valeriy Kravchuk
Thank you for the bug report. Verified on Windows XP.
[22 Nov 2010 13:15] Johannes Taxacher
#2 is a duplicate of Bug #54910
#3 is a duplicate of Bug #56950
[22 Nov 2010 14:40] Alfredo Kojima
Added confirmation dialog and multi-line comment for exported SQL file header
[8 Dec 2010 21:07] Johannes Taxacher
fix confirmed in repository
[6 Jan 2011 14:27] Tony Bedford
An entry has been added to the 5.2.31 changelog:

When exporting a recordset using the SQL INSERT statements file format, a number of issues were found:

The first line contained the executed SELECT statement as a comment but the LIMIT syntax was located in a new line. This resulted in the LIMIT part of the statement not being commented out.

Strings after the VALUES keyword were not quoted.

The INSERT statements did not contain the name of the exported table, simply the text “table”.

Existing files were overwritten without prompting.