19
19
select * from t1 ignore key (key1) where text1='teststring' or
20
20
text1 like 'teststring_%' ORDER BY text1;
22
21
select * from t1 where text1='teststring' or text1 like 'teststring_%';
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;
28
alter table t1 modify text1 char(32) not null;
26
alter table t1 modify text1 char(32) binary not null;
30
28
select * from t1 ignore key (key1) where text1='teststring' or
31
29
text1 like 'teststring_%' ORDER BY text1;
33
30
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
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;
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;
43
38
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
45
39
select concat('|', text1, '|') from t1 where text1='teststring';
47
40
select concat('|', text1, '|') from t1 where text1='teststring ';
49
alter table t1 modify text1 text not null;
42
alter table t1 modify text1 text not null, pack_keys=1;
51
43
select concat('|', text1, '|') from t1 where text1='teststring';
53
44
select concat('|', text1, '|') from t1 where text1='teststring ';
54
45
explain select concat('|', text1, '|') from t1 where text1='teststring ';
56
46
select concat('|', text1, '|') from t1 where text1 like 'teststring_%';
58
47
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
60
48
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
61
49
select concat('|', text1, '|') from t1 order by text1;
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');
67
54
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
69
55
select concat('|', text1, '|') from t1 where text1='teststring' or text1 >= 'teststring\t';
72
# Test MEMORY tables (with BTREE keys)
58
# Test HEAP tables (with BTREE keys)
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;
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');
95
80
select * from t1 where text1='teststring' or text1 like 'teststring_%';
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;
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;
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;
108
alter table t1 modify text1 text not null;
92
alter table t1 modify text1 text not null, pack_keys=1;
110
93
select * from t1 where text1 like 'teststring_%';
112
95
# The following gives wrong result in InnoDB
114
96
select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%';
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;