1002.1.2
by Devananda vdv
created test case for default database collation |
1 |
create database mysqltest collate = utf8_bin; |
2 |
use mysqltest; |
|
3 |
create table t1 (a varchar(10)); |
|
4 |
create table t2 (a varchar(10)) collate = utf8_general_ci; |
|
5 |
insert into t1 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab'); |
|
6 |
insert into t2 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab'); |
|
7 |
select * from t1 order by a; |
|
8 |
a
|
|
9 |
A
|
|
10 |
Aa
|
|
11 |
Ab
|
|
12 |
a
|
|
13 |
aA
|
|
14 |
ab
|
|
15 |
select * from t2 order by a; |
|
16 |
a
|
|
17 |
a
|
|
18 |
A
|
|
19 |
aA
|
|
20 |
Aa
|
|
21 |
ab
|
|
22 |
Ab
|
|
23 |
show create table t1; |
|
24 |
Table Create Table |
|
25 |
t1 CREATE TABLE `t1` ( |
|
26 |
`a` varchar(10) COLLATE utf8_bin DEFAULT NULL |
|
27 |
) ENGINE=InnoDB |
|
28 |
show create table t2; |
|
29 |
Table Create Table |
|
30 |
t2 CREATE TABLE `t2` ( |
|
31 |
`a` varchar(10) DEFAULT NULL |
|
32 |
) ENGINE=InnoDB |
|
33 |
select count(*) from t1 where a='a'; |
|
34 |
count(*) |
|
35 |
1
|
|
36 |
select count(*) from t2 where a='a'; |
|
37 |
count(*) |
|
38 |
2
|
|
39 |
select count(*) from t1 where a like 'a%'; |
|
40 |
count(*) |
|
41 |
3
|
|
42 |
select count(*) from t2 where a like 'a%'; |
|
43 |
count(*) |
|
44 |
6
|
|
45 |
drop table if exists t1; |
|
46 |
drop table if exists t2; |
|
47 |
drop database if exists mysqltest; |