Bug #4558 Escape handling error for ENUM values in SJIS encoding
Submitted: 15 Jul 2004 5:41 Modified: 27 Aug 2004 9:11
Reporter: Shuichi Tamagawa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.20 OS:Windows (Window XP Professional)
Assigned to: Alexander Barkov CPU Architecture:Any

[15 Jul 2004 5:41] Shuichi Tamagawa
Description:
When using SJIS character for ENUM value:

if the second byte of the double byte character is '5C' and server character set is SJIS, extra 5C is added to the character. As a result, "YEN SIGN" is added to the original character. 

e.g) 0x835C83748367(3 sjis characters) ---> 0x835C5C83748367 

if the second byte of the double byte character is '5C' and server character set is UJIS, 5C is omited as an escape symbol. As a result the character string get garbled.

e.g) 0x835C83748367(3 sjis characters) ---> 0x83583748367 

How to repeat:
Please see the attachment

Suggested fix:
Looks it should be the other way round.
[15 Jul 2004 5:43] Shuichi Tamagawa
server character set = sjis

Attachment: sjis.JPG (image/pjpeg, text), 43.51 KiB.

[15 Jul 2004 5:43] Shuichi Tamagawa
server character set = ujis

Attachment: ujis.JPG (image/pjpeg, text), 43.26 KiB.

[15 Jul 2004 6:05] Shuichi Tamagawa
Correction, the second example should be
0x835C83748367(3 sjis characters) ---> 0x8383748367
[27 Aug 2004 9:11] Alexander Barkov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html