~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/endspace.test

Merge/fix in FAQ.

Show diffs side-by-side

added added

removed removed

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