~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Test problem with characters < ' ' at end of strings (Bug #3152)
3
#
4
5
-- source include/have_innodb.inc
6
--disable_warnings
7
drop table if exists t1;
8
--enable_warnings
9
10
-- source include/endspace.inc
11
12
#
13
# Test MyISAM tables.
14
#
15
16
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
17
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
18
check table t1;
19
select * from t1 ignore key (key1) where text1='teststring' or 
20
  text1 like 'teststring_%' ORDER BY text1;
21
select * from t1 where text1='teststring' or text1 like 'teststring_%';
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
1217 by Brian Aker
Removed bits of charset support from the parser.
26
alter table t1 modify text1 char(32) not null;
1 by brian
clean slate
27
check table t1;
28
select * from t1 ignore key (key1) where text1='teststring' or 
29
  text1 like 'teststring_%' ORDER BY text1;
30
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
31
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
32
select text1, length(text1) from t1 order by text1;
1217 by Brian Aker
Removed bits of charset support from the parser.
33
select text1, length(text1) from t1 order by text1;
1 by brian
clean slate
34
35
alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
36
insert into t1 values ('teststring ');
37
select concat('|', text1, '|') from t1 order by text1;
38
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
39
select concat('|', text1, '|') from t1 where text1='teststring';
40
select concat('|', text1, '|') from t1 where text1='teststring ';
41
1117.1.4 by Brian Aker
Remove PACK_KEYS
42
alter table t1 modify text1 text not null;
1 by brian
clean slate
43
select concat('|', text1, '|') from t1 where text1='teststring';
44
select concat('|', text1, '|') from t1 where text1='teststring ';
45
explain select concat('|', text1, '|') from t1 where text1='teststring ';
46
select concat('|', text1, '|') from t1 where text1 like 'teststring_%';
47
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
48
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
49
select concat('|', text1, '|') from t1 order by text1;
50
drop table t1;
51
1117.1.4 by Brian Aker
Remove PACK_KEYS
52
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
1 by brian
clean slate
53
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
54
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
55
select concat('|', text1, '|') from t1 where text1='teststring' or text1 >= 'teststring\t';
56
drop table t1;
57
1233.2.1 by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias.
58
# Test MEMORY tables (with BTREE keys)
1 by brian
clean slate
59
1233.2.1 by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias.
60
create temporary table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=MEMORY;
1 by brian
clean slate
61
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
62
select * from t1 ignore key (key1) where text1='teststring' or 
63
  text1 like 'teststring_%' ORDER BY text1;
64
select * from t1 where text1='teststring' or text1 like 'teststring_%';
65
select * from t1 where text1='teststring' or text1 >= 'teststring\t';
66
select * from t1 order by text1;
67
explain select * from t1 order by text1;
68
1217 by Brian Aker
Removed bits of charset support from the parser.
69
alter table t1 modify text1 char(32) not null;
1 by brian
clean slate
70
select * from t1 order by text1;
71
drop table t1;
72
73
#
74
# Test InnoDB tables
75
#
76
77
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb;
78
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
79
check table t1;
80
select * from t1 where text1='teststring' or text1 like 'teststring_%';
81
select * from t1 where text1='teststring' or text1 > 'teststring\t';
82
select * from t1 order by text1;
83
explain select * from t1 order by text1;
84
1217 by Brian Aker
Removed bits of charset support from the parser.
85
alter table t1 modify text1 char(32) not null;
1 by brian
clean slate
86
select * from t1 order by text1;
87
88
alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
89
insert into t1 values ('teststring ');
90
select concat('|', text1, '|') from t1 order by text1;
91
1117.1.4 by Brian Aker
Remove PACK_KEYS
92
alter table t1 modify text1 text not null;
1 by brian
clean slate
93
select * from t1 where text1 like 'teststring_%';
94
95
# The following gives wrong result in InnoDB
96
select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%';
97
select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t';
98
select concat('|', text1, '|') from t1 order by text1;
99
drop table t1;
100
101
# End of 4.1 tests