a speadsheet with over 450 rows ist exported to csv-format. During the import I get an error for a row. So I tested two other spreadsheet versions. One with 3 rows - the error-row in the middle - will be imported without error. Then the version with 33 rows, it shows the earlier error again. After submitting this text, I load up the last 2 csv-files and a picture from teh message. Reproducible: Always
Created attachment 94112 [details] shows teh errormessage
Created attachment 94113 [details] imported 2 rows without error
Created attachment 94114 [details] csv-file wth 33 rows
Albrecht, Thanks for the detailed report. Regarding the attached CSV 94113. It contains 3 rows of data and all 3 are imported (Kexi 2.9.7-pre, shall be same in this regard as 2.9.5). Checking another CSV.
OK, row #22 failed to import. Looking there. The rest (31+the column names row) imported. Multiline rows valued imported too.
Created attachment 94195 [details] Minimal test for the bug One-column and 2 rows of data shows the issue: NULL 1 (attached) For this file the column is auto-detected as having primary key. It should not be like that, the first record is NULL.
Created attachment 94196 [details] A screenshot showing preview of file #94114 A screenshot showing relevant part of preview of file #94114. Column 24, like the file #94195 has NULL values, and then integer value (=3). It shouldn't default to primary key, it shouldn't even be allowed for primary key. @Albrecht: The current workaround before the issue is fixed in Kexi, would be to scroll to that column and switch off the "Primary key" check box before importing.
(altered the summary accordingly)
Created attachment 94204 [details] After a fix: test .kexi file with imported all 3 test files
Git commit 00e2c35899826db373726b18e602c01fc0c8ef46 by Jaroslaw Staniek. Committed on 26/08/2015 at 16:15. Pushed by staniek into branch 'calligra/2.9'. Kexi: Fix detection of primary key column on CSV import FIXED-IN:2.9.7 Also: * fix updates of primary key detection when value of 'Start at line' changes * simplify some code Test Plan: Attached to https://bugs.kde.org/show_bug.cgi?id=351487: * mussweg_1.csv - test passed * mussweg_2.csv - test showing error in row #22, details: https://bugs.kde.org/show_bug.cgi?id=351487#c5 * simple-err.csv - minimal test showing the bug (PK is detected); after the fix PK should not be detected Reviewers: piggz Subscribers: Kexi-Devel-list Differential Revision: https://phabricator.kde.org/D267 M +34 -27 kexi/plugins/importexport/csv/kexicsvimportdialog.cpp M +3 -1 kexi/plugins/importexport/csv/kexicsvimportdialog.h http://commits.kde.org/calligra/00e2c35899826db373726b18e602c01fc0c8ef46