Bug #59787 Export recordset to an external file creates invalid SQL insert statements
Submitted: 27 Jan 2011 23:51 Modified: 6 Jun 2011 19:09
Reporter: Anthony Stramer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.31 OS:Any
Assigned to: CPU Architecture:Any
Tags: export, insert, invalid, recordset, workbench

[27 Jan 2011 23:51] Anthony Stramer
Description:
Export recordset to an external file creates invalid SQL Insert statements when you export data from a table with a column name of 'key'.

How to repeat:
- Create a table that has a column name of 'key'
- Run a select statement on the table
- Use the 'Export recordset to an external file' to create SQL Insert statements
- Attempt to import the generated SQL Inserts

Suggested fix:
Append `s around the column names

INSERT INTO table (`key`, `value`) VALUES ('xx', 'xx');
[6 Jun 2011 19:09] Paul DuBois
Noted in 5.2.34 changelog.

Exporting a record set to a file resulted in invalid INSERT 
statements if the table contained a column named key because the
column name was not quoted properly.