⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
r
/
View File Name :
ctype_collate.result
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; CREATE TABLE t1 ( latin1_f CHAR(32) CHARACTER SET latin1 NOT NULL ); CREATE TABLE t2 ( latin1_f CHAR(32) CHARACTER SET latin1 COLLATE koi8r_general_ci NOT NULL ); ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1' CREATE TABLE t2 ( latin1_f CHAR(32) CHARACTER SET latin1 COLLATE some_non_existing_col NOT NULL ); ERROR HY000: Unknown collation: 'some_non_existing_col' INSERT INTO t1 (latin1_f) VALUES (_latin1'A'); INSERT INTO t1 (latin1_f) VALUES (_latin1'a'); INSERT INTO t1 (latin1_f) VALUES (_latin1'AD'); INSERT INTO t1 (latin1_f) VALUES (_latin1'ad'); INSERT INTO t1 (latin1_f) VALUES (_latin1'AE'); INSERT INTO t1 (latin1_f) VALUES (_latin1'ae'); INSERT INTO t1 (latin1_f) VALUES (_latin1'AF'); INSERT INTO t1 (latin1_f) VALUES (_latin1'af'); INSERT INTO t1 (latin1_f) VALUES (_latin1'�'); INSERT INTO t1 (latin1_f) VALUES (_latin1'�'); INSERT INTO t1 (latin1_f) VALUES (_latin1'�'); INSERT INTO t1 (latin1_f) VALUES (_latin1'�'); INSERT INTO t1 (latin1_f) VALUES (_latin1'B'); INSERT INTO t1 (latin1_f) VALUES (_latin1'b'); INSERT INTO t1 (latin1_f) VALUES (_latin1'U'); INSERT INTO t1 (latin1_f) VALUES (_latin1'u'); INSERT INTO t1 (latin1_f) VALUES (_latin1'UE'); INSERT INTO t1 (latin1_f) VALUES (_latin1'ue'); INSERT INTO t1 (latin1_f) VALUES (_latin1'�'); INSERT INTO t1 (latin1_f) VALUES (_latin1'�'); INSERT INTO t1 (latin1_f) VALUES (_latin1'SS'); INSERT INTO t1 (latin1_f) VALUES (_latin1'ss'); INSERT INTO t1 (latin1_f) VALUES (_latin1'�'); INSERT INTO t1 (latin1_f) VALUES (_latin1'Y'); INSERT INTO t1 (latin1_f) VALUES (_latin1'y'); INSERT INTO t1 (latin1_f) VALUES (_latin1'Z'); INSERT INTO t1 (latin1_f) VALUES (_latin1'z'); SELECT latin1_f FROM t1 ORDER BY latin1_f, hex(latin1_f); latin1_f A a AD ad AE ae AF af B b SS ss U u UE ue Y y � � Z z � � � � � SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_swedish_ci, hex(latin1_f); latin1_f A a AD ad AE ae AF af B b SS ss U u UE ue Y y � � Z z � � � � � SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci, hex(latin1_f); latin1_f A a � � AD ad AE ae � � AF af B b SS ss � U u UE ue � � Y y Z z SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci, hex(latin1_f); latin1_f A a AD ad AE ae AF af � � � � B b SS ss � U u UE ue � � Y y Z z SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin; latin1_f A AD AE AF B SS U UE Y Z a ad ae af b ss u ue y z � � � � � � � SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r_general_ci; ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1' SELECT latin1_f COLLATE latin1_swedish_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as, hex(latin1_f_as); latin1_f_as A a AD ad AE ae AF af B b SS ss U u UE ue Y y � � Z z � � � � � SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as, hex(latin1_f_as); latin1_f_as A a � � AD ad AE ae � � AF af B b SS ss � U u UE ue � � Y y Z z SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as, hex(latin1_f_as); latin1_f_as A a AD ad AE ae AF af � � � � B b SS ss � U u UE ue � � Y y Z z SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A AD AE AF B SS U UE Y Z a ad ae af b ss u ue y z � � � � � � � SELECT latin1_f COLLATE koi8r_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1' SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; latin1_f count(*) A 2 AD 2 AE 2 AF 2 B 2 SS 2 U 2 UE 2 � 4 Z 2 � 2 � 2 � 1 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_swedish_ci; latin1_f count(*) A 2 AD 2 AE 2 AF 2 B 2 SS 2 U 2 UE 2 � 4 Z 2 � 2 � 2 � 1 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci; latin1_f count(*) A 4 AD 2 AE 4 AF 2 B 2 SS 3 U 2 UE 4 Y 2 Z 2 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci; latin1_f count(*) A 2 AD 2 AE 2 AF 2 � 2 � 2 B 2 SS 2 � 1 U 2 UE 2 � 2 Y 2 Z 2 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin; latin1_f count(*) A 1 AD 1 AE 1 AF 1 B 1 SS 1 U 1 UE 1 Y 1 Z 1 a 1 ad 1 ae 1 af 1 b 1 ss 1 u 1 ue 1 y 1 z 1 � 1 � 1 � 1 � 1 � 1 � 1 � 1 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r_general_ci; ERROR 42000: COLLATION 'koi8r_general_ci' is not valid for CHARACTER SET 'latin1' SELECT DISTINCT latin1_f FROM t1; latin1_f A AD AE AF � � B U UE � SS � Z SELECT DISTINCT latin1_f COLLATE latin1_swedish_ci FROM t1; latin1_f COLLATE latin1_swedish_ci A AD AE AF � � B U UE � SS � Z SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1; latin1_f COLLATE latin1_german2_ci A AD AE AF B U UE SS Y Z SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1; latin1_f COLLATE latin1_general_ci A AD AE AF � � B U UE � SS � Y Z SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; latin1_f COLLATE latin1_bin A a AD ad AE ae AF af � � � � B b U u UE ue � � SS ss � Y y Z z SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; ERROR HY000: Unknown collation: 'koi8r' SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `latin1_f` char(32) NOT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 SHOW FIELDS FROM t1; Field Type Null Key Default Extra latin1_f char(32) NO NULL ALTER TABLE t1 CHANGE latin1_f latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `latin1_f` char(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 SHOW FIELDS FROM t1; Field Type Null Key Default Extra latin1_f char(32) YES NULL ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `latin1_f` char(32) COLLATE latin1_bin DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_bin SHOW FIELDS FROM t1; Field Type Null Key Default Extra latin1_f char(32) YES NULL SET CHARACTER SET 'latin1'; SHOW VARIABLES LIKE 'character_set_client'; Variable_name Value character_set_client latin1 SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; charset('a') collation('a') coercibility('a') 'a'='A' latin1 latin1_swedish_ci 4 1 explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Warning 1681 'EXTENDED' is deprecated and will be removed in a future release. Note 1003 /* select#1 */ select charset('a') AS `charset('a')`,collation('a') AS `collation('a')`,coercibility('a') AS `coercibility('a')`,('a' = 'A') AS `'a'='A'` SET CHARACTER SET koi8r; SHOW VARIABLES LIKE 'collation_client'; Variable_name Value SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; charset('a') collation('a') coercibility('a') 'a'='A' latin1 latin1_swedish_ci 4 1 SET CHARACTER SET 'DEFAULT'; ERROR 42000: Unknown character set: 'DEFAULT' DROP TABLE t1; CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci, s2 CHAR(5) COLLATE latin1_swedish_ci); SELECT * FROM t1 WHERE s1 = s2; ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '=' DROP TABLE t1; CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci, s2 CHAR(5) COLLATE latin1_swedish_ci, s3 CHAR(5) COLLATE latin1_bin); INSERT INTO t1 VALUES ('a','A','A'); SELECT * FROM t1 WHERE s1 = s2; ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '=' SELECT * FROM t1 WHERE s1 = s3; s1 s2 s3 SELECT * FROM t1 WHERE s2 = s3; s1 s2 s3 a A A DROP TABLE t1; create table t1 (a varchar(1) character set latin1 collate latin1_general_ci); insert into t1 values ('A'),('a'),('B'),('b'),('C'),('c'); select * from t1 where a > 'B' collate latin1_bin; a a b C c select * from t1 where a <> 'B' collate latin1_bin; a A a b C c create index i on t1 (a); select * from t1 where a > 'B' collate latin1_bin; a a b C c select * from t1 where a <> 'B' collate latin1_bin; a A a b C c drop table t1; SET NAMES latin1; CREATE TABLE t1 (s1 char(10) COLLATE latin1_german1_ci, s2 char(10) COLLATE latin1_swedish_ci, KEY(s1), KEY(s2)); INSERT INTO t1 VALUES ('a','a'); INSERT INTO t1 VALUES ('b','b'); INSERT INTO t1 VALUES ('c','c'); INSERT INTO t1 VALUES ('d','d'); INSERT INTO t1 VALUES ('e','e'); INSERT INTO t1 VALUES ('f','f'); INSERT INTO t1 VALUES ('g','g'); INSERT INTO t1 VALUES ('h','h'); INSERT INTO t1 VALUES ('i','i'); INSERT INTO t1 VALUES ('j','j'); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK EXPLAIN SELECT * FROM t1 WHERE s1='a'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref s1 s1 11 const 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s1` = 'a') EXPLAIN SELECT * FROM t1 WHERE s2='a'; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref s2 s2 11 const 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s2` = 'a') EXPLAIN SELECT * FROM t1 WHERE s1='a' COLLATE latin1_german1_ci; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref s1 s1 11 const 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s1` = ('a' collate latin1_german1_ci)) EXPLAIN SELECT * FROM t1 WHERE s2='a' COLLATE latin1_german1_ci; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ALL s2 NULL NULL NULL 10 10.00 Using where Warnings: Warning 1739 Cannot use ref access on index 's2' due to type or collation conversion on field 's2' Warning 1739 Cannot use range access on index 's2' due to type or collation conversion on field 's2' Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s2` = <cache>(('a' collate latin1_german1_ci))) EXPLAIN SELECT * FROM t1 WHERE s1 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range s1 s1 11 NULL 2 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s1` between 'a' and <cache>(('b' collate latin1_german1_ci))) EXPLAIN SELECT * FROM t1 WHERE s2 BETWEEN 'a' AND 'b' COLLATE latin1_german1_ci; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ALL s2 NULL NULL NULL 10 10.10 Using where Warnings: Warning 1739 Cannot use range access on index 's2' due to type or collation conversion on field 's2' Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s2` between 'a' and <cache>(('b' collate latin1_german1_ci))) EXPLAIN SELECT * FROM t1 WHERE s1 IN ('a','b' COLLATE latin1_german1_ci); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range s1 s1 11 NULL 2 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s1` in ('a',<cache>(('b' collate latin1_german1_ci)))) EXPLAIN SELECT * FROM t1 WHERE s2 IN ('a','b' COLLATE latin1_german1_ci); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ALL s2 NULL NULL NULL 10 20.00 Using where Warnings: Warning 1739 Cannot use range access on index 's2' due to type or collation conversion on field 's2' Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s2` in ('a',<cache>(('b' collate latin1_german1_ci)))) EXPLAIN SELECT * FROM t1 WHERE s1 LIKE 'a' COLLATE latin1_german1_ci; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range s1 s1 11 NULL 1 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s1` like <cache>(('a' collate latin1_german1_ci))) EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ALL s2 NULL NULL NULL 10 10.10 Using where Warnings: Warning 1739 Cannot use range access on index 's2' due to type or collation conversion on field 's2' Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,`test`.`t1`.`s2` AS `s2` from `test`.`t1` where (`test`.`t1`.`s2` like <cache>(('a' collate latin1_german1_ci))) DROP TABLE t1; create table t1(f1 varchar(10) character set latin2 collate latin2_hungarian_ci, key(f1)); insert into t1 set f1=0x3F3F9DC73F; insert into t1 set f1=0x3F3F1E563F; insert into t1 set f1=0x3F3F; check table t1 extended; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a)); insert into t1 set a=0x4c20; insert into t1 set a=0x6c; insert into t1 set a=0x4c98; check table t1 extended; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; Warnings: Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release. select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci); least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) a create table t1 select least(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) as f1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `f1` varchar(1) CHARACTER SET latin5 NOT NULL DEFAULT '' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 drop table t1; select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate latin5_turkish_ci then 2 else 3 end; case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate latin5_turkish_ci then 2 else 3 end 3 select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci); concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci) abc SET sql_mode = default; # # Bug#11765016 57926: ILLEGAL MIX OF COLLATIONS FOR OPERATION 'UNION' .. USING CONCAT/FUNCTION/ # Not a bug: only adding coverage tests # SET NAMES latin1 COLLATE latin1_german2_ci; CREATE DATABASE test1 DEFAULT CHARACTER SET latin1 COLLATE latin1_german2_ci; USE test1; # # Using "COLLATE latin1_swedish_ci" as the default collation for latin1 # CREATE FUNCTION `getText`() RETURNS varchar(20) CHARSET latin1 BEGIN RETURN "Testtext"; END;// SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText()); getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText()) Testtext latin1 latin1_swedish_ci 4 CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText(); ERROR HY000: Illegal mix of collations for operation 'UNION' DROP FUNCTION getText; # # Using "CHARACTER SET latin1 COLLATE latin1_german2_ci" as the database defaults # CREATE FUNCTION `getText`() RETURNS varchar(20) BEGIN RETURN "Testtext"; END;// SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText()); getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText()) Testtext latin1 latin1_german2_ci 4 CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText(); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(20) COLLATE latin1_german2_ci DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci DROP TABLE t1; DROP FUNCTION getText; # # Using explicit "CHARACTER SET latin1 COLLATE latin1_german2_ci" # CREATE FUNCTION `getText`() RETURNS varchar(20) CHARACTER SET latin1 COLLATE latin1_german2_ci BEGIN RETURN "Testtext"; END;// SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText()); getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText()) Testtext latin1 latin1_german2_ci 4 CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText(); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(20) COLLATE latin1_german2_ci DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci DROP TABLE t1; DROP FUNCTION getText; DROP DATABASE test1; USE test; SET NAMES latin1; # Bug#20425399: CAN'T USE COLLATE CREATE TABLE t1(a TINYINT, b SMALLINT, c MEDIUMINT, d INT, e BIGINT); CREATE TABLE t2(a DECIMAL(5,2)); CREATE TABLE t3(a FLOAT(5,2), b DOUBLE(5,2)); INSERT INTO t1 VALUES(1, 2, 3, 4, 100); INSERT INTO t1 VALUES(2, 3, 4, 100, 1); INSERT INTO t1 VALUES(3, 4, 100, 1, 2); INSERT INTO t1 VALUES(4, 100, 1, 2, 3); INSERT INTO t1 VALUES(100, 1, 2, 3, 4); SELECT * FROM t1 ORDER BY a; a b c d e 1 2 3 4 100 2 3 4 100 1 3 4 100 1 2 4 100 1 2 3 100 1 2 3 4 SELECT * FROM t1 ORDER BY a COLLATE utf8_bin; a b c d e 1 2 3 4 100 100 1 2 3 4 2 3 4 100 1 3 4 100 1 2 4 100 1 2 3 SELECT * FROM t1 ORDER BY b; a b c d e 100 1 2 3 4 1 2 3 4 100 2 3 4 100 1 3 4 100 1 2 4 100 1 2 3 SELECT * FROM t1 ORDER BY b COLLATE latin1_swedish_ci; a b c d e 100 1 2 3 4 4 100 1 2 3 1 2 3 4 100 2 3 4 100 1 3 4 100 1 2 SELECT * FROM t1 ORDER BY c; a b c d e 4 100 1 2 3 100 1 2 3 4 1 2 3 4 100 2 3 4 100 1 3 4 100 1 2 SELECT * FROM t1 ORDER BY c COLLATE gb2312_chinese_ci; a b c d e 4 100 1 2 3 3 4 100 1 2 100 1 2 3 4 1 2 3 4 100 2 3 4 100 1 SELECT * FROM t1 ORDER BY d; a b c d e 3 4 100 1 2 4 100 1 2 3 100 1 2 3 4 1 2 3 4 100 2 3 4 100 1 SELECT * FROM t1 ORDER BY d COLLATE ascii_general_ci; a b c d e 3 4 100 1 2 2 3 4 100 1 4 100 1 2 3 100 1 2 3 4 1 2 3 4 100 INSERT INTO t2 VALUES(1.01); INSERT INTO t2 VALUES(2.99); INSERT INTO t2 VALUES(100.49); SELECT * FROM t2 ORDER BY a; a 1.01 2.99 100.49 SELECT * FROM t2 ORDER BY a COLLATE latin1_german1_ci; a 1.01 100.49 2.99 INSERT INTO t3 VALUES(1.01, 2.99); INSERT INTO t3 VALUES(2.99, 100.49); INSERT INTO t3 VALUES(100.49, 1.01); SELECT * FROM t3 ORDER BY a; a b 1.01 2.99 2.99 100.49 100.49 1.01 SELECT * FROM t3 ORDER BY a COLLATE ascii_bin; a b 1.01 2.99 100.49 1.01 2.99 100.49 SELECT * FROM t3 ORDER BY b; a b 100.49 1.01 1.01 2.99 2.99 100.49 SELECT * FROM t3 ORDER BY b COLLATE utf8_general_ci; a b 2.99 100.49 100.49 1.01 1.01 2.99 DROP TABLE t1; DROP TABLE t2; DROP TABLE t3;