~drizzle-trunk/drizzle/development

1002.1.2 by Devananda vdv
created test case for default database collation
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;
1089.10.1 by Stewart Smith
fix SHOW CREATE DATABASE for default collation. Move database metadata reading code around to be a bit more sane.
11
show create database mysqltest;
1235.4.15 by Stewart Smith
commit test case showing buggy ALTER DATABASE COLLATE = foo that was broken by previous patch (fix coming in next commit)
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;
1002.1.2 by Devananda vdv
created test case for default database collation
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
1441 by Brian Aker
Fixing tests to work with PBXT.
31
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1002.1.2 by Devananda vdv
created test case for default database collation
32
show create table t1;
33
1441 by Brian Aker
Fixing tests to work with PBXT.
34
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1002.1.2 by Devananda vdv
created test case for default database collation
35
show create table t2;
36
37
select count(*) from t1 where a='a';
38
39
select count(*) from t2 where a='a';
40
41
select count(*) from t1 where a like 'a%';
42
43
select count(*) from t2 where a like 'a%';
44
45
drop table if exists t1;
46
47
drop table if exists t2;
48
49
drop database if exists mysqltest;
50
51