~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/default_collation.test

  • Committer: Devananda vdv
  • Date: 2009-05-02 23:57:11 UTC
  • mto: (1003.2.4 mordred)
  • mto: This revision was merged to the branch mainline in revision 1005.
  • Revision ID: devananda.vdv@gmail.com-20090502235711-kkqqd1kpwhfgoizw
created test case for default database collation

Show diffs side-by-side

added added

removed removed

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