Bug #72973 Duplicate entry for autogenerated primary key column
Submitted: 12 Jun 2014 2:24 Modified: 30 Jun 2014 23:28
Reporter: Javier Treviño Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL for Windows: MySQL for Excel Severity:S2 (Serious)
Version:1.2.1 OS:Any
Assigned to: CPU Architecture:Any

[12 Jun 2014 2:24] Javier Treviño
Description:
Duplicate entry (probably an extra row) is being sent to the server when exporting data to a new MySQL table after unchecking the "First Row Contains Column Names" checkbox.

How to repeat:
1. Enable the MySQL for excel plugin.
2. Open a valid connection.
3. Type something on a couple of cells.
4. Select those cells and click "Export excel data to a New table".
5. Allow the plugin to "Add a primary key column" to the table.
6. Make sure to Uncheck the "First Row Contains Column Names" checkbox.
7. Press the "Export data" button.
8. Error while inserting rows...
MySQL Error 1062:
Duplicate entry '1' for key 'PRIMARY'
[16 Jun 2014 22:54] Javier Treviño
Posted by developer:
 
This bug exists actually since version 1.2.1
[17 Jun 2014 22:55] Javier Treviño
Posted by developer:
 
Fixed the formula applied in the temporary Excel range used to feed the export data for a new MySQL table, the formula now considers the value of the option "First row contains column names" in the Export Data dialog.
[26 Jun 2014 19:42] Rafael Antonio Bedoy Torres
Posted by developer:
 
Fixed, checked using mysql-for-excel-commercial-1.3.1.
[30 Jun 2014 23:28] Philip Olson
Fixed as of the upcoming MySQL for Excel 1.3.1 release, and here's the changelog entry:

When exporting data, a duplicate entry was sent to the MySQL server when
data was exported to a new table with the "First Row Contains Column
Names" checkbox deselected. The generated error was similar to "Error
while inserting rows... MySQL Error 1062: Duplicate entry '1' for key
'PRIMARY'".

Thank you for the bug report.