Importing CSV file with enum field gives truncated error and no enum

[expired user #9019]'s profile image [expired user #9019] posted 9 years ago in Import/Export Permalink
My csv has a few varchar fields, an int field, and an enum.

On importing, it throws this error for each row
/* Warning (1265): Data truncated for column 'XXX' at row Y */

and the enum field which is default to a certain value is actually blank

The enum itself is a few characters long, so I wonder if it expects that the enum to be a single character

How to fix this? Why's it doing it?
ansgar's profile image ansgar posted 9 years ago Permalink
I'd say your enum column definition in your table does not contain the value(s) from your CSV file.
[expired user #9019]'s profile image [expired user #9019] posted 9 years ago Permalink
Enum field described as
enum('XXX','YYYY')

I'm only inserting YYYY's at the moment, the values in the CSV are definitely YYYY
so I don't know what I'm doing wrong
[expired user #9019]'s profile image [expired user #9019] posted 9 years ago Permalink
This was fixed by changing my line ending rules, the csv import has a rule for expecting line ending characters. Up til now mine were \n but the new files I was dealing with were \r\n which caused this error since the enum was the last member of the rows

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