import CSV with first column as AUTO_INCREMENT bug

[expired user #8757]'s profile image [expired user #8757] posted 9 years ago in General Permalink
Hello,

I found strange behavior(bug) when I try import from CSV and first column(`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT) in table have set default to AUTO_INCREMENT. Then after import CSV data in first imported column is set to 0.
But if I move AUTO_INCREMENT column to another position than 1 in order (in table layout) then CSV import data correctly.

Here is my testing table:
CREATE TABLE `import` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`letter` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin2_czech_cs',
`index` INT(11) NULL DEFAULT NULL, PRIMARY KEY (`id`)
) COLLATE='latin2_czech_cs' ENGINE=InnoDB;

And try to import this CSV data:
A;1
B;2
C;3
D;4

In import window I just uncheck `id` column for import(cuz is calculated) and run import. After import is finished I have all data in column `letter` set to 0. Data in column `index` is imported correctly.

Btw sorry for my English. It's not my native language.

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