Bug #7538 I can't use extended-ascii character
Submitted: 27 Dec 2004 7:10 Modified: 11 Jan 2005 13:56
Reporter: JANG HONG CHANG Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.8 OS:Linux (Linux RedHat 9.0)
Assigned to: Alexander Barkov CPU Architecture:Any

[27 Dec 2004 7:10] JANG HONG CHANG
Description:
I use mysql 3.23.x for my application

i can use korean language(charset: euc_kr) and extended-ascii character(over 128)

insert into test(ascii_column) values ( char(138) )
select ascii(ascii_column) from test;

it works well..

---

but i start using 4.1.8

I can't input/select extended-ascii character(over 128)

insert into test(ascii_column) values (char(138)) it works..
but
select ascii(ascii_column) from test;..  it doesn't work(it return 0)

---

I use other charset/collation
only 'latin1' charset support extend-ascii character.. but latin1 doesn't support korean language..

I think it's a serious bug.. 

plz help

How to repeat:

setting charset to 'euckr'

create table test ( ascii_column varchar(10) not null );

insert into test(ascii_column) values (char(138))

select ascii(ascii_column) from test;

then.. It doesn't work.

Suggested fix:

I want use euckr charset and extended-ascii char
[28 Dec 2004 20:01] MySQL Verification Team
Verified with latest 4.1 source tree.
[11 Jan 2005 13:56] Alexander Barkov
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

This is not a bug.
The problem is that a single byte with code 138 is not a valid EUC-KR
sequence. It is a beginning of a multi-byte sequence. Starting from 4.1,
MySQL doesn't allow to write a wrong mylti-byte sequences.

Note, a sequence of two bytes with codes 138 is a correct sequence.
This query works fine:

mysql> insert into t2 (a) values ( concat(char(138),char(138)));
Query OK, 1 row affected (0.00 sec)

And SELECT does return the value afterwards.