bug on CSV import

[expired user #7833]'s profile image [expired user #7833] posted 10 years ago in General Permalink
I have a CSV with missing values, like this:

A,B,C
D,E
F,G,H

HeidiSQL imports it like this:

A,B,C
D,EF,G

This makes no sense. I think it's more useful to split lines BEFORE fields, so the missing values to be the defaults.
kalvaro's profile image kalvaro posted 10 years ago Permalink
I cannot reproduce. I've created this table to test:

create table foo (
a varchar(50),
b varchar(50),
c varchar(50)
);


... and I'm getting this with your data:

---------------------------
Error
---------------------------
SQL Error (1261): Row 2 doesn't contain data for all columns
---------------------------
OK   
---------------------------
[expired user #7833]'s profile image [expired user #7833] posted 10 years ago Permalink
I use
Client parses file content

Unfortunately, I can't provide the real data.

But it seems HeidiSQL just takes values until every field is filled, even if it encounters the record delimiter. I think the file should be split in records (lines), and just then every record in fields.

Please login to leave a reply, or register at first.