Bug #14226 LOAD DATA INFILE with character set problem
Submitted: 22 Oct 2005 8:02 Modified: 22 Oct 2005 12:18
Reporter: MySQL-Front Team Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.13-rc OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[22 Oct 2005 8:02] MySQL-Front Team
Description:
While importing data with the LOAD DATA LOCAL INFILE query the character set will not be used well.

How to repeat:
SET NAMES latin1;

CREATE TABLE `test` (
  `Id` int(11) unsigned NOT NULL auto_increment,
  `Title` varchar(255) default NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

LOAD DATA LOCAL INFILE 'C:\\Temp\\test.csv'
  INTO TABLE `test`
  FIELDS
    TERMINATED BY ','
    ENCLOSED BY '\"'
  LINES
    TERMINATED BY '\r\n';

Use the attached file to input.
[22 Oct 2005 8:02] MySQL-Front Team
Test file with german characters

Attachment: test.csv (text/tab-separated-values), 19 bytes.

[22 Oct 2005 8:05] MySQL-Front Team
libMySQL.dll version: 5.0.13-rc
[22 Oct 2005 12:18] MySQL-Front Team
Sorry, my mistake.

On MySQL 5.x.x I have to use:
  SET SESSION character_set_database=latin1;
instead of
  SET NAMES latin1;