Bug #6223 Japanese half-width kana characters get truncated after INSERT/LOAD DATA
Submitted: 23 Oct 2004 1:16 Modified: 2 Nov 2004 5:04
Reporter: Shuichi Tamagawa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.7-GA OS:Linux (SuSE Linux 9.0/Win XP SP2)
Assigned to: Alexander Barkov CPU Architecture:Any

[23 Oct 2004 1:16] Shuichi Tamagawa
Description:
If Japanese half-with-kana in sjis is inserted into table by using LOAD DATA LOCAL INFILE, the characters get truncated. This happens only to half-with-kana(e.g. 0x82B1). In 4.1.6 or before, it was OK.

How to repeat:
Please see the attached image file to see the difference between 4.1.6 and 4.1.7. Also, use the attached text file for the file to load.
[23 Oct 2004 1:16] Shuichi Tamagawa
Test result in 4.1.6

Attachment: 4.1.6.PNG (image/png, text), 31.92 KiB.

[23 Oct 2004 1:16] Shuichi Tamagawa
Test result in 4.1.7

Attachment: 4.1.7.PNG (image/png, text), 33.95 KiB.

[23 Oct 2004 1:18] Shuichi Tamagawa
Please use this file for 'LOAD DATA' local infile (encoded in sjis)

Attachment: test_sjis.txt (text/plain), 68 bytes.

[25 Oct 2004 20:29] MySQL Verification Team
Also tested on Windows with latest BK source.
[26 Oct 2004 23:11] Shuichi Tamagawa
This also happens after INSERT operation.

root[test]>show create table t2\G
*************************** 1. row ***************************
       Table: t2
Create Table: CREATE TABLE `t2` (
  `c` char(16) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis
1 row in set (0.00 sec)

root[test]>insert into t2 values(0xb1),(0xb2),(0xb3);
Query OK, 3 rows affected, 3 warnings (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 3

root[test]>show warnings;
+---------+------+----------------------------------------+
| Level   | Code | Message                                |
+---------+------+----------------------------------------+
| Warning | 1265 | Data truncated for column 'c' at row 1 |
| Warning | 1265 | Data truncated for column 'c' at row 2 |
| Warning | 1265 | Data truncated for column 'c' at row 3 |
+---------+------+----------------------------------------+
3 rows in set (0.00 sec)