~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/t/default_collation.test

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

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
show create database mysqltest;
 
12
alter database mysqltest collate = utf8_general_ci;
 
13
show create database mysqltest;
 
14
alter database mysqltest collate = utf8_bin;
 
15
show create database mysqltest;
 
16
 
 
17
use mysqltest;
 
18
 
 
19
create table t1 (a varchar(10));
 
20
 
 
21
create table t2 (a varchar(10)) collate = utf8_general_ci;
 
22
 
 
23
insert into t1 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
 
24
 
 
25
insert into t2 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
 
26
 
 
27
select * from t1 order by a;
 
28
 
 
29
select * from t2 order by a;
 
30
 
 
31
show create table t1;
 
32
 
 
33
show create table t2;
 
34
 
 
35
select count(*) from t1 where a='a';
 
36
 
 
37
select count(*) from t2 where a='a';
 
38
 
 
39
select count(*) from t1 where a like 'a%';
 
40
 
 
41
select count(*) from t2 where a like 'a%';
 
42
 
 
43
drop table if exists t1;
 
44
 
 
45
drop table if exists t2;
 
46
 
 
47
drop database if exists mysqltest;
 
48
 
 
49