Commit 99befb58 authored by Alexander Barkov's avatar Alexander Barkov

Backporting "WL#3332 Korean Enhancements" and

"WL#4584 New euckr characters" from 5.4.
(as agreed on ServerPT meeting on July 8).
parent 47a9a252
This diff is collapsed.
...@@ -56,3 +56,54 @@ select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1; ...@@ -56,3 +56,54 @@ select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1;
drop table t1; drop table t1;
--echo End of 5.0 tests --echo End of 5.0 tests
--echo Start of 5.4 tests
--echo #
--echo # WL#3997 New euckr characters
--echo #
SET NAMES utf8;
CREATE TABLE t1 (a varchar(10) character set euckr);
INSERT INTO t1 VALUES (0xA2E6), (0xA2E7);
SELECT hex(a), hex(@utf8:=convert(a using utf8)), hex(convert(@utf8 using euckr)) FROM t1;
DROP TABLE t1;
--echo #
--echo # WL#3332 Korean Enhancements
--echo # euckr valid codes are now [81..FE][41..5A,61..7A,81..FE]
--echo #
CREATE TABLE t1 (a binary(1), key(a));
--disable_query_log
let $1=255;
while($1)
{
eval INSERT INTO t1 VALUES (unhex(hex($1)));
dec $1;
}
--enable_query_log
CREATE TABLE t2 (s VARCHAR(4), a VARCHAR(1) CHARACTER SET euckr);
--disable_warnings
INSERT INTO t2
SELECT hex(concat(t11.a, t12.a)), concat(t11.a, t12.a)
FROM t1 t11, t1 t12
WHERE t11.a >= 0x81 AND t11.a <= 0xFE
AND t12.a >= 0x41 AND t12.a <= 0xFE
ORDER BY t11.a, t12.a;
--enable_warnings
SELECT s as bad_code FROM t2 WHERE a='' ORDER BY s;
DELETE FROM t2 WHERE a='';
ALTER TABLE t2 ADD u VARCHAR(1) CHARACTER SET utf8, ADD a2 VARCHAR(1) CHARACTER SET euckr;
--disable_warnings
UPDATE t2 SET u=a, a2=u;
--enable_warnings
SELECT s as unassigned_code FROM t2 WHERE u='?';
DELETE FROM t2 WHERE u='?';
# Make sure there are no euckr->utf8->euckr roundtrip problems
SELECT count(*) as roundtrip_problem_chars FROM t2 WHERE hex(a) <> hex(a2);
SELECT s, hex(a), hex(u), hex(a2) FROM t2 ORDER BY s;
DROP TABLE t1, t2;
--echo End of 5.4 tests
...@@ -185,13 +185,13 @@ static uchar NEAR sort_order_euc_kr[]= ...@@ -185,13 +185,13 @@ static uchar NEAR sort_order_euc_kr[]=
Valid multi-byte characters: Valid multi-byte characters:
[A1..FE][41..5A,61..7A,81..FE] [81..FE][41..5A,61..7A,81..FE]
Note, 0x5C is not a valid MB tail, Note, 0x5C is not a valid MB tail,
so escape_with_backslash_is_dangerous is not set. so escape_with_backslash_is_dangerous is not set.
*/ */
#define iseuc_kr_head(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)) #define iseuc_kr_head(c) ((0x81<=(uchar)(c) && (uchar)(c)<=0xfe))
#define iseuc_kr_tail1(c) ((uchar) (c) >= 0x41 && (uchar) (c) <= 0x5A) #define iseuc_kr_tail1(c) ((uchar) (c) >= 0x41 && (uchar) (c) <= 0x5A)
#define iseuc_kr_tail2(c) ((uchar) (c) >= 0x61 && (uchar) (c) <= 0x7A) #define iseuc_kr_tail2(c) ((uchar) (c) >= 0x61 && (uchar) (c) <= 0x7A)
...@@ -1294,7 +1294,7 @@ static uint16 tab_ksc5601_uni0[]={ ...@@ -1294,7 +1294,7 @@ static uint16 tab_ksc5601_uni0[]={
0x25A8,0x25A7,0x25A6,0x25A9,0x2668,0x260F,0x260E,0x261C, 0x25A8,0x25A7,0x25A6,0x25A9,0x2668,0x260F,0x260E,0x261C,
0x261E,0x00B6,0x2020,0x2021,0x2195,0x2197,0x2199,0x2196, 0x261E,0x00B6,0x2020,0x2021,0x2195,0x2197,0x2199,0x2196,
0x2198,0x266D,0x2669,0x266A,0x266C,0x327F,0x321C,0x2116, 0x2198,0x266D,0x2669,0x266A,0x266C,0x327F,0x321C,0x2116,
0x33C7,0x2122,0x33C2,0x33D8,0x2121, 0, 0, 0, 0x33C7,0x2122,0x33C2,0x33D8,0x2121,0x20AC,0x00AE, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
...@@ -4172,7 +4172,7 @@ static int func_ksc5601_uni_onechar(int code){ ...@@ -4172,7 +4172,7 @@ static int func_ksc5601_uni_onechar(int code){
/* page 0 0x00A1-0x0167 */ /* page 0 0x00A1-0x0167 */
static uint16 tab_uni_ksc56010[]={ static uint16 tab_uni_ksc56010[]={
0xA2AE, 0, 0,0xA2B4, 0, 0,0xA1D7,0xA1A7, 0xA2AE, 0, 0,0xA2B4, 0, 0,0xA1D7,0xA1A7,
0,0xA8A3, 0, 0,0xA1A9, 0, 0,0xA1C6, 0,0xA8A3, 0, 0,0xA1A9,0xA2E7, 0,0xA1C6,
0xA1BE,0xA9F7,0xA9F8,0xA2A5, 0,0xA2D2,0xA1A4,0xA2AC, 0xA1BE,0xA9F7,0xA9F8,0xA2A5, 0,0xA2D2,0xA1A4,0xA2AC,
0xA9F6,0xA8AC, 0,0xA8F9,0xA8F6,0xA8FA,0xA2AF, 0, 0xA9F6,0xA8AC, 0,0xA8F9,0xA8F6,0xA8FA,0xA2AF, 0,
0, 0, 0, 0, 0,0xA8A1, 0, 0, 0, 0, 0, 0, 0,0xA8A1, 0, 0,
...@@ -4270,7 +4270,7 @@ static uint16 tab_uni_ksc56012[]={ ...@@ -4270,7 +4270,7 @@ static uint16 tab_uni_ksc56012[]={
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0xA2E6,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
......
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