LOAD DATA INFILE and (french) accentuated filenames
Posted by: Jay Bertrand
Date: June 02, 2005 09:15AM

Hi,

I'm experiencing a charset problem on accentuated filenames when using
'LOAD DATA INFILE' or 'SELECT INTO OUTFILE' on Mysql 4.1.12.

Here's my configuration:

> SELECT VERSION();
+---------------------+
| version() |
+---------------------+
| 4.1.11-Debian_4-log |
+---------------------+
1 row in set (0.00 sec)

> SHOW VARIABLES LIKE 'character_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
7 rows in set (0.00 sec)

When using accents in the filename, i get an error like:

> LOAD DATA LOCAL INFILE 'Période.csv' ...
ERROR 2 (HY000): File 'Période.csv' not found (Errcode: 2)

If I rename the original file from 'Période.csv' to 'Période.csv', everything's fine!
It seems that the filename is converted into utf8 by mysqld and not converted back
into something like "charset_set_connection" when sent back to client. Same problem
happens with 5.0.6b on W2K (but worked fined in 4.0.x).

The same thing happens when using 'SELECT INTO OUTFILE'. For example:

> SELECT * INTO OUTFILE 'Période.csv' FROM ...

% ls
Période.csv

Now, when i change character set to utf8, mysql behaves has expected (really don't understand why ?!?):

> SET character_set_client=utf8;
> SELECT * INTO OUTFILE 'Période.csv' FROM ...

% ls
Période.csv

In any above case, the content of the file is correctly interpreted:

% cat Période.csv
1;Janvier
2;Février
...

> SELECT * FROM periode;
+------------+--------------------------+
| id_periode | libelle_periode |
+------------+--------------------------+
| 1 | Janvier |
| 2 | Février |
| ... | |
+------------+--------------------------+


Didn't find anything about that with a google search :-( Is it a bug ?

TIA,

Regards,
JAY

Options: ReplyQuote


Subject
Views
Written By
Posted
LOAD DATA INFILE and (french) accentuated filenames
5203
June 02, 2005 09:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.