I'm trying to load data into a table (obviously?). My table looks like this:
CREATE TABLE IF NOT EXISTS `condensed` (
`id` bigint(20) NOT NULL,
`src` enum('C_X','C_AH','C_AO','C_B','H_X','H_AH','H_AO','H_B') NOT NULL,
`hash` int(11) default NULL,
`ihash` int(11) default NULL,
`last_updated` datetime default NULL,
PRIMARY KEY (`id`,`src`),
UNIQUE KEY `covering` (`id`,`src`,`hash`)
) ENGINE=MyISAM DEFAULT CHARSET=ascii;
I've got data files with look like this:
320115816,'C_X',692983698,854142703,20120216220954
320124536,'C_X',588472049,1059436251,20100527232845
320120196,'C_X',452117509,855369958,20101118105505
...
But when I load it using
LOAD DATA INFILE '/path/to/data.csv'
IGNORE
INTO TABLE `condensed`
(id, src, hash, ihash, last_updated);
it only loads the first two columns (hash, ihash and last_updated are null).
320115816,'C_X',NULL,NULL,NULL
320124536,'C_X',NULL,NULL,NULL
320120196,'C_X',NULL,NULL,NULL
...
I do get a lot of warnings (presumably because mysql is discarding the 3 columns from the input set and assigning defaults)
Query OK, 20 rows affected, 100 warnings (0.00 sec)
Records: 20 Deleted: 0 Skipped: 0 Warnings: 100
(I intend to load several milion records - not just 20)
I get the same problem using mysqlimport.
Omitting an explicit field list from the LOAD DATA statement (same fields and order in database as in files) resulted in the same outcome.
MySQL version is 5.0.22, there are no non-printable characters in the input file.
Help!