Commit 46aa022a authored by unknown's avatar unknown

ctype_sjis.result, ctype_sjis.test, ctype-sjis.c:

  Bug #6223 Japanese half-width kana characters get truncated. Bytes 0xA1..0xDF were not treated as a single byte sequence in a mistake.


strings/ctype-sjis.c:
  Bug #6223 Japanese half-width kana characters get truncated. Bytes 0xA1..0xDF were not treated as a single byte sequence in a mistake.
mysql-test/t/ctype_sjis.test:
  Bug #6223 Japanese half-width kana characters get truncated. Bytes 0xA1..0xDF were not treated as a single byte sequence in a mistake.
mysql-test/r/ctype_sjis.result:
  Bug #6223 Japanese half-width kana characters get truncated. Bytes 0xA1..0xDF were not treated as a single byte sequence in a mistake.
parent f8a875a2
...@@ -60,3 +60,14 @@ hex(c) ...@@ -60,3 +60,14 @@ hex(c)
9353 9353
9373 9373
drop table t1; drop table t1;
SET NAMES sjis;
CREATE TABLE t1 (
c char(16) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis;
insert into t1 values(0xb1),(0xb2),(0xb3);
select hex(c) from t1;
hex(c)
B1
B2
B3
drop table t1;
...@@ -51,3 +51,14 @@ insert into t1 values (0x9353); ...@@ -51,3 +51,14 @@ insert into t1 values (0x9353);
insert into t1 values (0x9373); insert into t1 values (0x9373);
select hex(c) from t1; select hex(c) from t1;
drop table t1; drop table t1;
#
# Bug #6223 Japanese half-width kana characters get truncated
#
SET NAMES sjis;
CREATE TABLE t1 (
c char(16) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=sjis;
insert into t1 values(0xb1),(0xb2),(0xb3);
select hex(c) from t1;
drop table t1;
...@@ -4581,14 +4581,19 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), ...@@ -4581,14 +4581,19 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
*/ */
if (((int8)b[0]) >= 0) if (((int8)b[0]) >= 0)
{ {
/* Single byte character */ /* Single byte ascii character */
b+= 1; b++;
} }
else if (issjishead((uchar)*b) && (e-b)>1 && issjistail((uchar)b[1])) else if (issjishead((uchar)*b) && (e-b)>1 && issjistail((uchar)b[1]))
{ {
/* Double byte character */ /* Double byte character */
b+= 2; b+= 2;
} }
else if (((uchar)*b) >= 0xA1 && ((uchar)*b) <= 0xDF)
{
/* Half width kana */
b++;
}
else else
{ {
/* Wrong byte sequence */ /* Wrong byte sequence */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment