1
--source include/have_ucs2.inc
4
drop table if exists t1;
9
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
10
show variables like 'character_sets_dir%';
12
show collation like 'utf8_test_ci';
13
create table t1 (c1 char(1) character set utf8 collate utf8_test_ci);
14
insert into t1 values ('a');
15
select * from t1 where c1='b';
18
show collation like 'ucs2_test_ci';
19
create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci);
20
insert into t1 values ('a');
21
select * from t1 where c1='b';
26
# Bug#41084 full-text index added to custom UCA collation not working
29
col1 varchar(100) character set utf8 collate utf8_test_ci
31
INSERT INTO t1 (col1) VALUES ('abcd'),('efgh'),('ijkl');
32
ALTER TABLE t1 ADD FULLTEXT INDEX (col1);
33
SELECT * FROM t1 where match (col1) against ('abcd');
34
SELECT * FROM t1 where match (col1) against ('abcd' IN BOOLEAN MODE);
35
ALTER TABLE t1 ADD (col2 varchar(100) character set latin1);
36
UPDATE t1 SET col2=col1;
37
SELECT * FROM t1 WHERE col1=col2 ORDER BY col1;
41
--echo # Bug#45645 Mysql server close all connection and restart using lower function
43
CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8 COLLATE utf8_test_ci;
44
INSERT INTO t1 (a) VALUES ('hello!');
45
SELECT * FROM t1 WHERE LOWER(a)=LOWER('N');
49
--echo # Bug#43827 Server closes connections and restarts
51
# Crash happened with a user-defined utf8 collation,
52
# on attempt to insert a string longer than the column can store.
53
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
54
INSERT INTO t1 SELECT REPEAT('a',11);
58
# Vietnamese experimental collation
61
show collation like 'ucs2_vn_ci';
62
create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
63
insert into t1 values (0x0061),(0x0041),(0x00E0),(0x00C0),(0x1EA3),(0x1EA2),
64
(0x00E3),(0x00C3),(0x00E1),(0x00C1),(0x1EA1),(0x1EA0);
65
insert into t1 values (0x0103),(0x0102),(0x1EB1),(0x1EB0),(0x1EB3),(0x1EB2),
66
(0x1EB5),(0x1EB4),(0x1EAF),(0x1EAE),(0x1EB7),(0x1EB6);
67
insert into t1 values (0x00E2),(0x00C2),(0x1EA7),(0x1EA6),(0x1EA9),(0x1EA8),
68
(0x1EAB),(0x1EAA),(0x1EA5),(0x1EA4),(0x1EAD),(0x1EAC);
69
insert into t1 values ('b'),('B'),('c'),('C');
70
insert into t1 values ('d'),('D'),(0x0111),(0x0110);
71
insert into t1 values (0x0065),(0x0045),(0x00E8),(0x00C8),(0x1EBB),(0x1EBA),
72
(0x1EBD),(0x1EBC),(0x00E9),(0x00C9),(0x1EB9),(0x1EB8);
73
insert into t1 values (0x00EA),(0x00CA),(0x1EC1),(0x1EC0),(0x1EC3),(0x1EC2),
74
(0x1EC5),(0x1EC4),(0x1EBF),(0x1EBE),(0x1EC7),(0x1EC6);
75
insert into t1 values ('g'),('G'),('h'),('H');
76
insert into t1 values (0x0069),(0x0049),(0x00EC),(0x00CC),(0x1EC9),(0x1EC8),
77
(0x0129),(0x0128),(0x00ED),(0x00CD),(0x1ECB),(0x1ECA);
78
insert into t1 values ('k'),('K'),('l'),('L'),('m'),('M');
79
insert into t1 values (0x006F),(0x004F),(0x00F2),(0x00D2),(0x1ECF),(0x1ECE),
80
(0x00F5),(0x00D5),(0x00F3),(0x00D3),(0x1ECD),(0x1ECC);
81
insert into t1 values (0x00F4),(0x00D4),(0x1ED3),(0x1ED2),(0x1ED5),(0x1ED4),
82
(0x1ED7),(0x1ED6),(0x1ED1),(0x1ED0),(0x1ED9),(0x1ED8);
83
insert into t1 values (0x01A1),(0x01A0),(0x1EDD),(0x1EDC),(0x1EDF),(0x1EDE),
84
(0x1EE1),(0x1EE0),(0x1EDB),(0x1EDA),(0x1EE3),(0x1EE2);
85
insert into t1 values ('p'),('P'),('q'),('Q'),('r'),('R'),('s'),('S'),('t'),('T');
86
insert into t1 values (0x0075),(0x0055),(0x00F9),(0x00D9),(0x1EE7),(0x1EE6),
87
(0x0169),(0x0168),(0x00FA),(0x00DA),(0x1EE5),(0x1EE4);
88
insert into t1 values (0x01B0),(0x01AF),(0x1EEB),(0x1EEA),(0x1EED),(0x1EEC),
89
(0x1EEF),(0x1EEE),(0x1EE9),(0x1EE8),(0x1EF1),(0x1EF0);
90
insert into t1 values ('v'),('V'),('x'),('X');
91
insert into t1 values (0x0079),(0x0059),(0x1EF3),(0x1EF2),(0x1EF7),(0x1EF6),
92
(0x1EF9),(0x1EF8),(0x00FD),(0x00DD),(0x1EF5),(0x1EF4);
93
select hex(c1) as h, c1 from t1 order by c1, h;
94
select group_concat(hex(c1) order by hex(c1)) from t1 group by c1;
95
select group_concat(c1 order by hex(c1) SEPARATOR '') from t1 group by c1;
98
--echo Bug#46448 trailing spaces are not ignored when user collation maps space != 0x20
100
show collation like 'latin1_test';
101
select "foo" = "foo " collate latin1_test;