1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#
# test for per-db default collation
# this should become the default for tables created in that db
#
# https://blueprints.launchpad.net/drizzle/+spec/default-collation-test
#
# assuming system default collation is utf8_general_ci
create database mysqltest collate = utf8_bin;
use mysqltest;
create table t1 (a varchar(10));
create table t2 (a varchar(10)) collate = utf8_general_ci;
insert into t1 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
insert into t2 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
select * from t1 order by a;
select * from t2 order by a;
show create table t1;
show create table t2;
select count(*) from t1 where a='a';
select count(*) from t2 where a='a';
select count(*) from t1 where a like 'a%';
select count(*) from t2 where a like 'a%';
drop table if exists t1;
drop table if exists t2;
drop database if exists mysqltest;
|