drop table if exists t1;
SET @test_character_set= 'big5';
SET @test_collation= 'big5_chinese_ci';
SET @safe_character_set_server= @@character_set_server;
SET @safe_collation_server= @@collation_server;
SET @safe_character_set_client= @@character_set_client;
SET @safe_character_set_results= @@character_set_results;
SET character_set_server= @test_character_set;
SET collation_server= @test_collation;
CREATE DATABASE d1;
USE d1;
CREATE TABLE t1 (c CHAR(10), KEY(c));
SHOW FULL COLUMNS FROM t1;
Field	Type	Collation	Null	Key	Default	Extra	Privileges	Comment
c	char(10)	big5_chinese_ci	YES	MUL	NULL			
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
want3results
aaa
aaaa
aaaaa
DROP TABLE t1;
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
SHOW FULL COLUMNS FROM t1;
Field	Type	Collation	Null	Key	Default	Extra	Privileges	Comment
c1	varchar(15)	big5_chinese_ci	YES	MUL	NULL			
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
SELECT c1 as want3results from t1 where c1 like 'l%';
want3results
location
loberge
lotre
SELECT c1 as want3results from t1 where c1 like 'lo%';
want3results
location
loberge
lotre
SELECT c1 as want1result  from t1 where c1 like 'loc%';
want1result
location
SELECT c1 as want1result  from t1 where c1 like 'loca%';
want1result
location
SELECT c1 as want1result  from t1 where c1 like 'locat%';
want1result
location
SELECT c1 as want1result  from t1 where c1 like 'locati%';
want1result
location
SELECT c1 as want1result  from t1 where c1 like 'locatio%';
want1result
location
SELECT c1 as want1result  from t1 where c1 like 'location%';
want1result
location
DROP TABLE t1;
create table t1 (a set('a') not null);
insert into t1 values (),();
Warnings:
Warning	1364	Field 'a' doesn't have a default value
select cast(a as char(1)) from t1;
cast(a as char(1))


select a sounds like a from t1;
a sounds like a
1
1
select 1 from t1 order by cast(a as char(1));
1
1
1
drop table t1;
set names utf8;
create table t1 (
name varchar(10),
level smallint unsigned);
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `name` varchar(10) DEFAULT NULL,
  `level` smallint(5) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=big5
insert into t1 values ('string',1);
select concat(name,space(level)), concat(name, repeat(' ',level)) from t1;
concat(name,space(level))	concat(name, repeat(' ',level))
string 	string 
drop table t1;
DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
SET character_set_client= @safe_character_set_client;
SET character_set_results= @safe_character_set_results;
SET NAMES big5;
SET collation_connection='big5_chinese_ci';
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a)	hex(a)
big5_chinese_ci	6109
big5_chinese_ci	61
big5_chinese_ci	6120
drop table t1;
create table t1 engine=innodb select repeat('a',50) as c1;
alter table t1 add index(c1(5));
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
select collation(c1) from t1 limit 1;
collation(c1)
big5_chinese_ci
select c1 from t1 where c1 like 'abcdef%' order by c1;
c1
abcdefg
select c1 from t1 where c1 like 'abcde1%' order by c1;
c1
abcde100
abcde110
abcde111
select c1 from t1 where c1 like 'abcde11%' order by c1;
c1
abcde110
abcde111
select c1 from t1 where c1 like 'abcde111%' order by c1;
c1
abcde111
drop table t1;
select @@collation_connection;
@@collation_connection
big5_chinese_ci
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a	hex(b)	c
2	F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2	
3	F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2	
4	F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2	
DROP TABLE t1;
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
select group_concat(c1 order by binary c1 SEPARATOR ''), group_concat(hex(c1)) from t1 group by c1;
group_concat(c1 order by binary c1 SEPARATOR '')	group_concat(hex(c1))
 	20
!	21
"	22
#	23
$	24
%	25
&	26
'	27
(	28
)	29
*	2A
+	2B
,	2C
-	2D
.	2E
/	2F
0	30
1	31
2	32
3	33
4	34
5	35
6	36
7	37
8	38
9	39
:	3A
;	3B
<	3C
=	3D
>	3E
?	3F
@	40
Aa	41,61
Bb	62,42
Cc	63,43
Dd	64,44
Ee	65,45
Ff	66,46
Gg	67,47
Hh	68,48
Ii	49,69
Jj	4A,6A
Kk	4B,6B
Ll	6C,4C
Mm	6D,4D
Nn	4E,6E
Oo	6F,4F
Pp	70,50
Qq	71,51
Rr	72,52
Ss	73,53
Tt	74,54
Uu	55,75
Vv	56,76
Ww	57,77
Xx	58,78
Yy	59,79
Zz	5A,7A
]	5D
[	5B
\	5C
^	5E
_	5F
`	60
{	7B
|	7C
}	7D
~	7E
	7F
drop table t1;
SET collation_connection='big5_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a)	hex(a)
big5_bin	6109
big5_bin	61
big5_bin	6120
drop table t1;
create table t1 engine=innodb select repeat('a',50) as c1;
alter table t1 add index(c1(5));
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
select collation(c1) from t1 limit 1;
collation(c1)
big5_bin
select c1 from t1 where c1 like 'abcdef%' order by c1;
c1
abcdefg
select c1 from t1 where c1 like 'abcde1%' order by c1;
c1
abcde100
abcde110
abcde111
select c1 from t1 where c1 like 'abcde11%' order by c1;
c1
abcde110
abcde111
select c1 from t1 where c1 like 'abcde111%' order by c1;
c1
abcde111
drop table t1;
select @@collation_connection;
@@collation_connection
big5_bin
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
insert into t1 values('abcdef');
insert into t1 values('_bcdef');
insert into t1 values('a_cdef');
insert into t1 values('ab_def');
insert into t1 values('abc_ef');
insert into t1 values('abcd_f');
insert into t1 values('abcde_');
select c1 as c1u from t1 where c1 like 'ab\_def';
c1u
ab_def
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a	hex(b)	c
2	F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2	
3	F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2	
4	F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2	
DROP TABLE t1;
SET NAMES big5;
CREATE TABLE t1 (a text) character set big5;
INSERT INTO t1 VALUES ('ùØ');
SELECT * FROM t1;
a
ùØ
DROP TABLE t1;
CREATE TABLE t1 (a CHAR(50) CHARACTER SET big5 NOT NULL, FULLTEXT(a));
INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E);
SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE);
HEX(a)
A741ADCCA66EB6DC20A7DAADCCABDCA66E
DROP TABLE t1;
set names big5;
create table t1 (a char character set big5);
insert into t1 values (0xF9D6),(0xF9D7),(0xF9D8),(0xF9D9);
insert into t1 values (0xF9DA),(0xF9DB),(0xF9DC);
select hex(a) a, hex(@u:=convert(a using utf8)) b,
hex(convert(@u using big5)) c from t1 order by a;
a	b	c
F9D6	E7A281	F9D6
F9D7	E98AB9	F9D7
F9D8	E8A38F	F9D8
F9D9	E5A2BB	F9D9
F9DA	E68192	F9DA
F9DB	E7B2A7	F9DB
F9DC	E5ABBA	F9DC
alter table t1 convert to character set utf8;
select hex(a) from t1 where a = _big5 0xF9DC;
hex(a)
E5ABBA
drop table t1;
select hex(convert(_big5 0xC84041 using ucs2));
hex(convert(_big5 0xC84041 using ucs2))
003F0041
End of 4.1 tests
set names big5;
create table t1 (a blob);
insert into t1 values (0xEE00);
select * into outfile 'test/t1.txt' from t1;
delete from t1;
select hex(load_file('MYSQLD_DATADIR/test/t1.txt'));;
hex(load_file('MYSQLD_DATADIR/test/t1.txt'))
5CEE5C300A
load data infile 't1.txt' into table t1;
select hex(a) from t1;
hex(a)
EE00
drop table t1;
End of 5.0 tests
set names big5;
select @@collation_connection;
@@collation_connection
big5_chinese_ci
select hex(weight_string('a'));
hex(weight_string('a'))
41
select hex(weight_string('A'));
hex(weight_string('A'))
41
select hex(weight_string('abc'));
hex(weight_string('abc'))
414243
select hex(weight_string('abc' as char(2)));
hex(weight_string('abc' as char(2)))
4142
select hex(weight_string('abc' as char(3)));
hex(weight_string('abc' as char(3)))
414243
select hex(weight_string('abc' as char(5)));
hex(weight_string('abc' as char(5)))
4142432020
select hex(weight_string('abc', 1, 2, 0xC0));
hex(weight_string('abc', 1, 2, 0xC0))
41
select hex(weight_string('abc', 2, 2, 0xC0));
hex(weight_string('abc', 2, 2, 0xC0))
4142
select hex(weight_string('abc', 3, 2, 0xC0));
hex(weight_string('abc', 3, 2, 0xC0))
414220
select hex(weight_string('abc', 4, 2, 0xC0));
hex(weight_string('abc', 4, 2, 0xC0))
41422020
select hex(weight_string('abc', 5, 2, 0xC0));
hex(weight_string('abc', 5, 2, 0xC0))
4142202020
select hex(weight_string('abc',25, 2, 0xC0));
hex(weight_string('abc',25, 2, 0xC0))
41422020202020202020202020202020202020202020202020
select hex(weight_string('abc', 1, 3, 0xC0));
hex(weight_string('abc', 1, 3, 0xC0))
41
select hex(weight_string('abc', 2, 3, 0xC0));
hex(weight_string('abc', 2, 3, 0xC0))
4142
select hex(weight_string('abc', 3, 3, 0xC0));
hex(weight_string('abc', 3, 3, 0xC0))
414243
select hex(weight_string('abc', 4, 3, 0xC0));
hex(weight_string('abc', 4, 3, 0xC0))
41424320
select hex(weight_string('abc', 5, 3, 0xC0));
hex(weight_string('abc', 5, 3, 0xC0))
4142432020
select hex(weight_string('abc',25, 3, 0xC0));
hex(weight_string('abc',25, 3, 0xC0))
41424320202020202020202020202020202020202020202020
select hex(weight_string('abc', 1, 4, 0xC0));
hex(weight_string('abc', 1, 4, 0xC0))
41
select hex(weight_string('abc', 2, 4, 0xC0));
hex(weight_string('abc', 2, 4, 0xC0))
4142
select hex(weight_string('abc', 3, 4, 0xC0));
hex(weight_string('abc', 3, 4, 0xC0))
414243
select hex(weight_string('abc', 4, 4, 0xC0));
hex(weight_string('abc', 4, 4, 0xC0))
41424320
select hex(weight_string('abc', 5, 4, 0xC0));
hex(weight_string('abc', 5, 4, 0xC0))
4142432020
select hex(weight_string('abc',25, 4, 0xC0));
hex(weight_string('abc',25, 4, 0xC0))
41424320202020202020202020202020202020202020202020
select @@collation_connection;
@@collation_connection
big5_chinese_ci
select hex(weight_string('a' LEVEL 1));
hex(weight_string('a' LEVEL 1))
41
select hex(weight_string('A' LEVEL 1));
hex(weight_string('A' LEVEL 1))
41
select hex(weight_string('abc' LEVEL 1));
hex(weight_string('abc' LEVEL 1))
414243
select hex(weight_string('abc' as char(2) LEVEL 1));
hex(weight_string('abc' as char(2) LEVEL 1))
4142
select hex(weight_string('abc' as char(3) LEVEL 1));
hex(weight_string('abc' as char(3) LEVEL 1))
414243
select hex(weight_string('abc' as char(5) LEVEL 1));
hex(weight_string('abc' as char(5) LEVEL 1))
4142432020
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
2020434241
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
BEBDBCDFDF
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
DFDFBCBDBE
select collation(cast(0xA1A1 as char));
collation(cast(0xA1A1 as char))
big5_chinese_ci
select hex(weight_string(cast(0x6141 as char)));
hex(weight_string(cast(0x6141 as char)))
4141
select hex(weight_string(cast(0xA1A1 as char)));
hex(weight_string(cast(0xA1A1 as char)))
A140
select hex(weight_string(cast(0xA1A1 as char) as char(1)));
hex(weight_string(cast(0xA1A1 as char) as char(1)))
A140
select hex(weight_string(cast(0xA1A1A1A1 as char) as char(1)));
hex(weight_string(cast(0xA1A1A1A1 as char) as char(1)))
A140
select hex(weight_string(cast(0xA1A1 as char) as char(3)));
hex(weight_string(cast(0xA1A1 as char) as char(3)))
A1402020
select hex(weight_string(cast(0xA1A1A1A1 as char) as char(3)));
hex(weight_string(cast(0xA1A1A1A1 as char) as char(3)))
A140A14020
select hex(weight_string(cast(0x40A1A1 as char) as char(3)));
hex(weight_string(cast(0x40A1A1 as char) as char(3)))
40A14020
select hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3)));
hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3)))
40A140A140
select hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3)));
hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3)))
40A140A140
select hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3)));
hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3)))
4040A140
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 2, 0xC0))
A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 2, 0xC0))
A140
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 2, 0xC0))
A140A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 2, 0xC0))
A140A140
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 2, 0xC0))
A140A14020
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 2, 0xC0))
A140A140202020202020202020202020202020202020202020
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 3, 0xC0))
A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 3, 0xC0))
A140
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 3, 0xC0))
A140A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 3, 0xC0))
A140A140
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 3, 0xC0))
A140A140A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 3, 0xC0))
A140A140A14020202020202020202020202020202020202020
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 4, 0xC0))
A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 4, 0xC0))
A140
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 4, 0xC0))
A140A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 4, 0xC0))
A140A140
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 4, 0xC0))
A140A140A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 4, 0xC0))
A140A140A14020202020202020202020202020202020202020
set collation_connection=big5_bin;
select @@collation_connection;
@@collation_connection
big5_bin
select hex(weight_string('a'));
hex(weight_string('a'))
61
select hex(weight_string('A'));
hex(weight_string('A'))
41
select hex(weight_string('abc'));
hex(weight_string('abc'))
616263
select hex(weight_string('abc' as char(2)));
hex(weight_string('abc' as char(2)))
6162
select hex(weight_string('abc' as char(3)));
hex(weight_string('abc' as char(3)))
616263
select hex(weight_string('abc' as char(5)));
hex(weight_string('abc' as char(5)))
6162632020
select hex(weight_string('abc', 1, 2, 0xC0));
hex(weight_string('abc', 1, 2, 0xC0))
61
select hex(weight_string('abc', 2, 2, 0xC0));
hex(weight_string('abc', 2, 2, 0xC0))
6162
select hex(weight_string('abc', 3, 2, 0xC0));
hex(weight_string('abc', 3, 2, 0xC0))
616220
select hex(weight_string('abc', 4, 2, 0xC0));
hex(weight_string('abc', 4, 2, 0xC0))
61622020
select hex(weight_string('abc', 5, 2, 0xC0));
hex(weight_string('abc', 5, 2, 0xC0))
6162202020
select hex(weight_string('abc',25, 2, 0xC0));
hex(weight_string('abc',25, 2, 0xC0))
61622020202020202020202020202020202020202020202020
select hex(weight_string('abc', 1, 3, 0xC0));
hex(weight_string('abc', 1, 3, 0xC0))
61
select hex(weight_string('abc', 2, 3, 0xC0));
hex(weight_string('abc', 2, 3, 0xC0))
6162
select hex(weight_string('abc', 3, 3, 0xC0));
hex(weight_string('abc', 3, 3, 0xC0))
616263
select hex(weight_string('abc', 4, 3, 0xC0));
hex(weight_string('abc', 4, 3, 0xC0))
61626320
select hex(weight_string('abc', 5, 3, 0xC0));
hex(weight_string('abc', 5, 3, 0xC0))
6162632020
select hex(weight_string('abc',25, 3, 0xC0));
hex(weight_string('abc',25, 3, 0xC0))
61626320202020202020202020202020202020202020202020
select hex(weight_string('abc', 1, 4, 0xC0));
hex(weight_string('abc', 1, 4, 0xC0))
61
select hex(weight_string('abc', 2, 4, 0xC0));
hex(weight_string('abc', 2, 4, 0xC0))
6162
select hex(weight_string('abc', 3, 4, 0xC0));
hex(weight_string('abc', 3, 4, 0xC0))
616263
select hex(weight_string('abc', 4, 4, 0xC0));
hex(weight_string('abc', 4, 4, 0xC0))
61626320
select hex(weight_string('abc', 5, 4, 0xC0));
hex(weight_string('abc', 5, 4, 0xC0))
6162632020
select hex(weight_string('abc',25, 4, 0xC0));
hex(weight_string('abc',25, 4, 0xC0))
61626320202020202020202020202020202020202020202020
select @@collation_connection;
@@collation_connection
big5_bin
select hex(weight_string('a' LEVEL 1));
hex(weight_string('a' LEVEL 1))
61
select hex(weight_string('A' LEVEL 1));
hex(weight_string('A' LEVEL 1))
41
select hex(weight_string('abc' LEVEL 1));
hex(weight_string('abc' LEVEL 1))
616263
select hex(weight_string('abc' as char(2) LEVEL 1));
hex(weight_string('abc' as char(2) LEVEL 1))
6162
select hex(weight_string('abc' as char(3) LEVEL 1));
hex(weight_string('abc' as char(3) LEVEL 1))
616263
select hex(weight_string('abc' as char(5) LEVEL 1));
hex(weight_string('abc' as char(5) LEVEL 1))
6162632020
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
2020636261
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
9E9D9CDFDF
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
DFDF9C9D9E
select collation(cast(0xA1A1 as char));
collation(cast(0xA1A1 as char))
big5_bin
select hex(weight_string(cast(0x6141 as char)));
hex(weight_string(cast(0x6141 as char)))
6141
select hex(weight_string(cast(0xA1A1 as char)));
hex(weight_string(cast(0xA1A1 as char)))
A1A1
select hex(weight_string(cast(0xA1A1 as char) as char(1)));
hex(weight_string(cast(0xA1A1 as char) as char(1)))
A1A1
select hex(weight_string(cast(0xA1A1A1A1 as char) as char(1)));
hex(weight_string(cast(0xA1A1A1A1 as char) as char(1)))
A1A1
select hex(weight_string(cast(0xA1A1 as char) as char(3)));
hex(weight_string(cast(0xA1A1 as char) as char(3)))
A1A12020
select hex(weight_string(cast(0xA1A1A1A1 as char) as char(3)));
hex(weight_string(cast(0xA1A1A1A1 as char) as char(3)))
A1A1A1A120
select hex(weight_string(cast(0x40A1A1 as char) as char(3)));
hex(weight_string(cast(0x40A1A1 as char) as char(3)))
40A1A120
select hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3)));
hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3)))
40A1A1A1A1
select hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3)));
hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3)))
40A1A1A1A1
select hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3)));
hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3)))
4040A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 2, 0xC0))
A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 2, 0xC0))
A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 2, 0xC0))
A1A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 2, 0xC0))
A1A1A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 2, 0xC0))
A1A1A1A120
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 2, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 2, 0xC0))
A1A1A1A1202020202020202020202020202020202020202020
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 3, 0xC0))
A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 3, 0xC0))
A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 3, 0xC0))
A1A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 3, 0xC0))
A1A1A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 3, 0xC0))
A1A1A1A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 3, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 3, 0xC0))
A1A1A1A1A1A120202020202020202020202020202020202020
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 4, 0xC0))
A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 4, 0xC0))
A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 4, 0xC0))
A1A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 4, 0xC0))
A1A1A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 4, 0xC0))
A1A1A1A1A1
select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 4, 0xC0));
hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 4, 0xC0))
A1A1A1A1A1A120202020202020202020202020202020202020
