~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/endspace.test

  • Committer: Devananda
  • Date: 2009-07-04 01:55:13 UTC
  • mto: (1086.10.1 length-plugin)
  • mto: This revision was merged to the branch mainline in revision 1095.
  • Revision ID: deva@myst-20090704015513-gtqliazxtfm7sdvf
refactored function/length into plugin/length

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
-- source include/endspace.inc
11
11
 
12
12
#
13
 
# Test default engine tables.
 
13
# Test MyISAM tables.
14
14
#
15
15
 
16
16
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
18
18
check table t1;
19
19
select * from t1 ignore key (key1) where text1='teststring' or 
20
20
  text1 like 'teststring_%' ORDER BY text1;
21
 
--sorted_result
22
21
select * from t1 where text1='teststring' or text1 like 'teststring_%';
23
 
--sorted_result
24
22
select * from t1 where text1='teststring' or text1 > 'teststring\t';
25
23
select * from t1 order by text1;
26
24
explain select * from t1 order by text1;
27
25
 
28
 
alter table t1 modify text1 char(32) not null;
 
26
alter table t1 modify text1 char(32) binary not null;
29
27
check table t1;
30
28
select * from t1 ignore key (key1) where text1='teststring' or 
31
29
  text1 like 'teststring_%' ORDER BY text1;
32
 
--sorted_result
33
30
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
34
 
--sorted_result
35
31
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
36
32
select text1, length(text1) from t1 order by text1;
37
 
select text1, length(text1) from t1 order by text1;
 
33
select text1, length(text1) from t1 order by binary text1;
38
34
 
39
35
alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
40
36
insert into t1 values ('teststring ');
41
37
select concat('|', text1, '|') from t1 order by text1;
42
 
--sorted_result
43
38
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
44
 
--sorted_result
45
39
select concat('|', text1, '|') from t1 where text1='teststring';
46
 
--sorted_result
47
40
select concat('|', text1, '|') from t1 where text1='teststring ';
48
41
 
49
 
alter table t1 modify text1 text not null;
50
 
--sorted_result
 
42
alter table t1 modify text1 text not null, pack_keys=1;
51
43
select concat('|', text1, '|') from t1 where text1='teststring';
52
 
--sorted_result
53
44
select concat('|', text1, '|') from t1 where text1='teststring ';
54
45
explain select concat('|', text1, '|') from t1 where text1='teststring ';
55
 
--sorted_result
56
46
select concat('|', text1, '|') from t1 where text1 like 'teststring_%';
57
 
--sorted_result
58
47
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
59
 
--sorted_result
60
48
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
61
49
select concat('|', text1, '|') from t1 order by text1;
62
50
drop table t1;
63
51
 
64
 
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
 
52
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) pack_keys=0;
65
53
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
66
 
--sorted_result
67
54
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
68
 
--sorted_result
69
55
select concat('|', text1, '|') from t1 where text1='teststring' or text1 >= 'teststring\t';
70
56
drop table t1;
71
57
 
72
 
# Test MEMORY tables (with BTREE keys)
 
58
# Test HEAP tables (with BTREE keys)
73
59
 
74
 
create temporary table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=MEMORY;
 
60
create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap;
75
61
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
76
62
select * from t1 ignore key (key1) where text1='teststring' or 
77
63
  text1 like 'teststring_%' ORDER BY text1;
80
66
select * from t1 order by text1;
81
67
explain select * from t1 order by text1;
82
68
 
83
 
alter table t1 modify text1 char(32) not null;
 
69
alter table t1 modify text1 char(32) binary not null;
84
70
select * from t1 order by text1;
85
71
drop table t1;
86
72
 
91
77
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb;
92
78
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
93
79
check table t1;
94
 
--sorted_result
95
80
select * from t1 where text1='teststring' or text1 like 'teststring_%';
96
 
--sorted_result
97
81
select * from t1 where text1='teststring' or text1 > 'teststring\t';
98
82
select * from t1 order by text1;
99
83
explain select * from t1 order by text1;
100
84
 
101
 
alter table t1 modify text1 char(32) not null;
 
85
alter table t1 modify text1 char(32) binary not null;
102
86
select * from t1 order by text1;
103
87
 
104
88
alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
105
89
insert into t1 values ('teststring ');
106
90
select concat('|', text1, '|') from t1 order by text1;
107
91
 
108
 
alter table t1 modify text1 text not null;
109
 
--sorted_result
 
92
alter table t1 modify text1 text not null, pack_keys=1;
110
93
select * from t1 where text1 like 'teststring_%';
111
94
 
112
95
# The following gives wrong result in InnoDB
113
 
--sorted_result
114
96
select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%';
115
 
--sorted_result
116
97
select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t';
117
98
select concat('|', text1, '|') from t1 order by text1;
118
99
drop table t1;