1
-- source include/have_euckr.inc
4
# Tests with the euckr character set
7
drop table if exists t1;
10
SET @test_character_set= 'euckr';
11
SET @test_collation= 'euckr_korean_ci';
12
-- source include/ctype_common.inc
15
SET collation_connection='euckr_korean_ci';
16
-- source include/ctype_filesort.inc
17
-- source include/ctype_innodb_like.inc
18
-- source include/ctype_like_escape.inc
19
-- source include/ctype_like_range_f1f2.inc
20
SET collation_connection='euckr_bin';
21
-- source include/ctype_filesort.inc
22
-- source include/ctype_innodb_like.inc
23
-- source include/ctype_like_escape.inc
24
-- source include/ctype_like_range_f1f2.inc
27
# Bug#15377 Valid multibyte sequences are truncated on INSERT
30
CREATE TABLE t1 (a text) character set euckr;
31
INSERT INTO t1 VALUES (0xA2E6),(0xFEF7);
32
SELECT hex(a) FROM t1 ORDER BY a;
38
#Bug #30315 Character sets: insertion of euckr code value 0xa141 fails
40
create table t1 (s1 varchar(5) character set euckr);
41
# Insert some valid characters
42
insert into t1 values (0xA141);
43
insert into t1 values (0xA15A);
44
insert into t1 values (0xA161);
45
insert into t1 values (0xA17A);
46
insert into t1 values (0xA181);
47
insert into t1 values (0xA1FE);
48
# Insert some invalid characters
49
insert into t1 values (0xA140);
50
insert into t1 values (0xA15B);
51
insert into t1 values (0xA160);
52
insert into t1 values (0xA17B);
53
insert into t1 values (0xA180);
54
insert into t1 values (0xA1FF);
55
select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1;
58
--echo End of 5.0 tests
61
--echo Start of 5.4 tests
64
--echo # WL#3997 New euckr characters
67
CREATE TABLE t1 (a varchar(10) character set euckr);
68
INSERT INTO t1 VALUES (0xA2E6), (0xA2E7);
69
SELECT hex(a), hex(@utf8:=convert(a using utf8)), hex(convert(@utf8 using euckr)) FROM t1;
73
--echo # WL#3332 Korean Enhancements
74
--echo # euckr valid codes are now [81..FE][41..5A,61..7A,81..FE]
77
CREATE TABLE t1 (a binary(1), key(a));
82
eval INSERT INTO t1 VALUES (unhex(hex($1)));
87
CREATE TABLE t2 (s VARCHAR(4), a VARCHAR(1) CHARACTER SET euckr);
90
SELECT hex(concat(t11.a, t12.a)), concat(t11.a, t12.a)
92
WHERE t11.a >= 0x81 AND t11.a <= 0xFE
93
AND t12.a >= 0x41 AND t12.a <= 0xFE
94
ORDER BY t11.a, t12.a;
96
SELECT s as bad_code FROM t2 WHERE a='' ORDER BY s;
97
DELETE FROM t2 WHERE a='';
98
ALTER TABLE t2 ADD u VARCHAR(1) CHARACTER SET utf8, ADD a2 VARCHAR(1) CHARACTER SET euckr;
100
UPDATE t2 SET u=a, a2=u;
102
SELECT s as unassigned_code FROM t2 WHERE u='?';
103
DELETE FROM t2 WHERE u='?';
104
# Make sure there are no euckr->utf8->euckr roundtrip problems
105
SELECT count(*) as roundtrip_problem_chars FROM t2 WHERE hex(a) <> hex(a2);
106
SELECT s, hex(a), hex(u), hex(a2) FROM t2 ORDER BY s;
109
--echo End of 5.4 tests