I’ve been trying to import a CSV file that contains lines of the format:
2,14883,020709090007,020126430606,CGChiw==
2,14884,020709090010,020126430507,Mq5S/A==
2,14885,020709090014,020114582403,qG/7TA==
I had wanted to import them into a table with the following format:
CREATE TABLE `csv_import_tmp` (
`col_a` int(10) default NULL,
`col_b` int(10) default NULL,
`col_c` varchar(255) default NULL,
`col_d` varchar(255) default NULL,
`col_e` varchar(255) default NULL,
`col_f` varchar(255) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Note: this table didn’t previously exist and I defined the mapping above during the step in the import wizard. (I’ve also tried with this table pre-defined, doesn’t make a difference).
Once the data is imported I would have expected `col_c` and `col_d` to contain the values 020709090007 and 020126430606 (from example line 1 above) however it’s giving me imported data as 20709090007.0 and 20126430606.0. It looks like it’s ignoring the mapping as “varchar” and instead processing it as a float / double datatype instead.
Is this a bug, as I believe the example contains valid CSV data …
Thanks,
Steve.