1
by brian
clean slate |
1 |
#
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
2 |
# Test of MEMORY tables. |
1
by brian
clean slate |
3 |
#
|
4 |
||
5 |
--disable_warnings
|
|
6 |
drop table if exists t1,t2,t3; |
|
7 |
--enable_warnings
|
|
8 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
9 |
create temporary table t1 (a int not null,b int not null, primary key (a)) engine=MEMORY comment="testing heaps"; |
1
by brian
clean slate |
10 |
insert into t1 values(1,1),(2,2),(3,3),(4,4); |
11 |
delete from t1 where a=1 or a=0; |
|
1320.1.18
by Brian Aker
Overhaul of SHOW TABLE STATUS. |
12 |
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
|
1273.19.10
by Brian Aker
Add support for listing temporay tables from show commands. |
13 |
show table status like "t1"; |
1273.19.12
by Brian Aker
Enabled more tests. |
14 |
show keys from t1; |
1
by brian
clean slate |
15 |
select * from t1; |
16 |
select * from t1 where a=4; |
|
17 |
update t1 set b=5 where a=4; |
|
18 |
update t1 set b=b+1 where a>=3; |
|
19 |
replace t1 values (3,3); |
|
20 |
select * from t1; |
|
21 |
alter table t1 add c int not null, add key (c,a); |
|
22 |
drop table t1; |
|
23 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
24 |
create temporary table t1 (a int not null,b int not null, primary key (a)) engine=memory comment="testing heaps"; |
1
by brian
clean slate |
25 |
insert into t1 values(1,1),(2,2),(3,3),(4,4); |
26 |
delete from t1 where a > 0; |
|
27 |
select * from t1; |
|
28 |
drop table t1; |
|
29 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
30 |
create temporary table t1 (a int not null,b int not null, primary key (a)) engine=MEMORY comment="testing heaps"; |
1
by brian
clean slate |
31 |
insert into t1 values(1,1),(2,2),(3,3),(4,4); |
1063.9.3
by Brian Aker
Partial fix for tests for tmp |
32 |
alter table t1 modify a int not null auto_increment, engine=innodb, comment="new innodb table"; |
1320.1.18
by Brian Aker
Overhaul of SHOW TABLE STATUS. |
33 |
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
|
1273.19.10
by Brian Aker
Add support for listing temporay tables from show commands. |
34 |
show table status like "t1"; |
1
by brian
clean slate |
35 |
select * from t1; |
36 |
drop table t1; |
|
37 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
38 |
create temporary table t1 (a int not null) engine=MEMORY; |
1
by brian
clean slate |
39 |
insert into t1 values (869751),(736494),(226312),(802616),(728912); |
40 |
select * from t1 where a > 736494; |
|
41 |
alter table t1 add unique uniq_id(a); |
|
42 |
select * from t1 where a > 736494; |
|
43 |
select * from t1 where a = 736494; |
|
44 |
select * from t1 where a=869751 or a=736494; |
|
45 |
select * from t1 where a in (869751,736494,226312,802616); |
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
46 |
create temporary table t2 SELECT * FROM t1; |
1063.9.3
by Brian Aker
Partial fix for tests for tmp |
47 |
explain select * from t2 where a in (869751,736494,226312,802616); |
48 |
drop table t1,t2; |
|
1
by brian
clean slate |
49 |
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
50 |
create temporary table t1 (x int not null, y int not null, key x (x), unique y (y)) |
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
51 |
engine=MEMORY; |
1
by brian
clean slate |
52 |
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6); |
53 |
select * from t1 where x=1; |
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
54 |
-- error 1137
|
1
by brian
clean slate |
55 |
select * from t1,t1 as t2 where t1.x=t2.y; |
1106.3.1
by Brian Aker
Heap is now tmp only table |
56 |
-- error 1137
|
1
by brian
clean slate |
57 |
explain select * from t1,t1 as t2 where t1.x=t2.y; |
58 |
drop table t1; |
|
59 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
60 |
create temporary table t1 (a int) engine=MEMORY; |
1
by brian
clean slate |
61 |
insert into t1 values(1); |
62 |
select max(a) from t1; |
|
63 |
drop table t1; |
|
64 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
65 |
CREATE TEMPORARY TABLE t1 ( a int not null default 0, b int not null default 0, key(a), key(b) ) ENGINE=MEMORY; |
1
by brian
clean slate |
66 |
insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6); |
67 |
select * from t1 where a=1; |
|
68 |
insert into t1 values(1,1),(1,2),(2,3),(1,3),(1,4),(1,5),(1,6); |
|
69 |
select * from t1 where a=1; |
|
70 |
drop table t1; |
|
71 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
72 |
create temporary table t1 (id int not null, primary key (id)) engine=MEMORY; |
1
by brian
clean slate |
73 |
insert into t1 values(1); |
74 |
select max(id) from t1; |
|
75 |
insert into t1 values(2); |
|
76 |
select max(id) from t1; |
|
77 |
replace into t1 values(1); |
|
78 |
drop table t1; |
|
79 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
80 |
create temporary table t1 (n int) engine=MEMORY; |
1
by brian
clean slate |
81 |
drop table t1; |
82 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
83 |
create temporary table t1 (n int) engine=MEMORY; |
1
by brian
clean slate |
84 |
drop table if exists t1; |
85 |
||
86 |
# Test of non unique index |
|
87 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
88 |
CREATE TEMPORARY table t1(f1 int not null,f2 char(20) not |
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
89 |
null,index(f2)) engine=MEMORY; |
1
by brian
clean slate |
90 |
INSERT into t1 set f1=12,f2="bill"; |
91 |
INSERT into t1 set f1=13,f2="bill"; |
|
92 |
INSERT into t1 set f1=14,f2="bill"; |
|
93 |
INSERT into t1 set f1=15,f2="bill"; |
|
94 |
INSERT into t1 set f1=16,f2="ted"; |
|
95 |
INSERT into t1 set f1=12,f2="ted"; |
|
96 |
INSERT into t1 set f1=12,f2="ted"; |
|
97 |
INSERT into t1 set f1=12,f2="ted"; |
|
98 |
INSERT into t1 set f1=12,f2="ted"; |
|
99 |
delete from t1 where f2="bill"; |
|
100 |
select * from t1; |
|
101 |
drop table t1; |
|
102 |
||
103 |
#
|
|
104 |
# Test when using part key searches |
|
105 |
#
|
|
106 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
107 |
create temporary table t1 (btn char(10) not null, key(btn)) engine=MEMORY; |
1
by brian
clean slate |
108 |
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i"); |
109 |
explain select * from t1 where btn like "q%"; |
|
110 |
select * from t1 where btn like "q%"; |
|
111 |
alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn; |
|
112 |
update t1 set new_col=left(btn,1); |
|
113 |
explain select * from t1 where btn="a"; |
|
114 |
explain select * from t1 where btn="a" and new_col="a"; |
|
115 |
drop table t1; |
|
116 |
||
117 |
#
|
|
118 |
# Test of NULL keys |
|
119 |
#
|
|
120 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
121 |
CREATE TEMPORARY TABLE t1 ( |
1
by brian
clean slate |
122 |
a int default NULL, |
123 |
b int default NULL, |
|
124 |
KEY a (a), |
|
125 |
UNIQUE b (b) |
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
126 |
) engine=MEMORY; |
1
by brian
clean slate |
127 |
INSERT INTO t1 VALUES (NULL,99),(99,NULL),(1,1),(2,2),(1,3); |
128 |
SELECT * FROM t1 WHERE a=NULL; |
|
129 |
explain SELECT * FROM t1 WHERE a IS NULL; |
|
130 |
SELECT * FROM t1 WHERE a<=>NULL; |
|
131 |
SELECT * FROM t1 WHERE b=NULL; |
|
132 |
explain SELECT * FROM t1 WHERE b IS NULL; |
|
133 |
SELECT * FROM t1 WHERE b<=>NULL; |
|
134 |
||
135 |
--error ER_DUP_ENTRY
|
|
136 |
INSERT INTO t1 VALUES (1,3); |
|
137 |
DROP TABLE t1; |
|
138 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
139 |
CREATE TEMPORARY TABLE t1 ( |
1
by brian
clean slate |
140 |
a int default NULL, |
141 |
key a (a) |
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
142 |
) ENGINE=MEMORY; |
1
by brian
clean slate |
143 |
INSERT INTO t1 VALUES (10), (10), (10); |
144 |
EXPLAIN SELECT * FROM t1 WHERE a=10; |
|
145 |
SELECT * FROM t1 WHERE a=10; |
|
146 |
DROP TABLE t1; |
|
147 |
||
148 |
#
|
|
149 |
# Test when deleting all rows |
|
150 |
#
|
|
151 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
152 |
CREATE TEMPORARY TABLE t1 (a int not null, primary key(a)) engine=MEMORY; |
1
by brian
clean slate |
153 |
INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11); |
154 |
DELETE from t1 where a < 100; |
|
155 |
SELECT * from t1; |
|
156 |
DROP TABLE t1; |
|
157 |
||
158 |
#
|
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
159 |
# Bug#4411 Server hangs when trying to SELECT MAX(id) from an empty MEMORY table |
1
by brian
clean slate |
160 |
#
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
161 |
CREATE TEMPORARY TABLE `job_titles` ( |
413.2.2
by Brian Aker
Removed UNSIGNED from parser. |
162 |
`job_title_id` int NOT NULL default '0', |
1
by brian
clean slate |
163 |
`job_title` char(18) NOT NULL default '', |
164 |
PRIMARY KEY (`job_title_id`), |
|
165 |
UNIQUE KEY `job_title_id` (`job_title_id`,`job_title`) |
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
166 |
) ENGINE=MEMORY; |
1
by brian
clean slate |
167 |
|
168 |
SELECT MAX(job_title_id) FROM job_titles; |
|
169 |
||
170 |
DROP TABLE job_titles; |
|
171 |
||
172 |
#
|
|
173 |
# Test of delete with NOT NULL |
|
174 |
# (Bug #6082) |
|
175 |
#
|
|
176 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
177 |
CREATE TEMPORARY TABLE t1 (a INT NOT NULL, B INT, KEY(B)) ENGINE=MEMORY; |
1
by brian
clean slate |
178 |
INSERT INTO t1 VALUES(1,1), (1,NULL); |
179 |
SELECT * FROM t1 WHERE B is not null; |
|
180 |
DROP TABLE t1; |
|
181 |
||
182 |
#
|
|
183 |
# Bug #6748 |
|
184 |
# heap_rfirst() doesn't work (and never did!) |
|
185 |
#
|
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
186 |
CREATE TEMPORARY TABLE t1 (pseudo char(35) PRIMARY KEY, date int NOT NULL) ENGINE=MEMORY;
|
1
by brian
clean slate |
187 |
INSERT INTO t1 VALUES ('massecot',1101106491),('altec',1101106492),('stitch+',1101106304),('Seb Corgan',1101106305),('beerfilou',1101106263),('flaker',1101106529),('joce8',5),('M4vrick',1101106418),('gabay008',1101106525),('Vamp irX',1101106291),('ZoomZip',1101106546),('rip666',1101106502),('CBP ',1101106397),('guezpard',1101106496); |
188 |
DELETE FROM t1 WHERE date<1101106546;
|
|
189 |
SELECT * FROM t1;
|
|
190 |
DROP TABLE t1;
|
|
191 |
||
192 |
#
|
|
193 |
# Bug #6878: a problem with small length records
|
|
194 |
#
|
|
195 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
196 |
create temporary table t1(a char(2)) engine=memory;
|
1
by brian
clean slate |
197 |
insert into t1 values (NULL), (NULL);
|
198 |
delete from t1 where a is null;
|
|
199 |
insert into t1 values ('2'), ('3'); |
|
200 |
select * from t1;
|
|
201 |
drop table t1;
|
|
202 |
||
203 |
#
|
|
204 |
# Test varchar
|
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
205 |
# We can't use varchar.inc becasue MEMORY doesn't support blob's |
1
by brian
clean slate |
206 |
#
|
207 |
||
208 |
let $default=`select @@storage_engine`; |
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
209 |
set storage_engine=MEMORY; |
1
by brian
clean slate |
210 |
|
211 |
#
|
|
212 |
# Simple basic test that endspace is saved |
|
213 |
#
|
|
214 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
215 |
create temporary table t1 (v varchar(10), c char(10), t varchar(50)); |
1
by brian
clean slate |
216 |
insert into t1 values('+ ', '+ ', '+ '); |
217 |
set @a=repeat(' ',20); |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
218 |
--error ER_DATA_TOO_LONG
|
1637
by Brian Aker
Merge in changes to call error on bad data input. |
219 |
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a)); |
220 |
set @a=repeat(' ',10); |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
221 |
--error ER_DATA_TOO_LONG
|
1637
by Brian Aker
Merge in changes to call error on bad data input. |
222 |
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a)); |
223 |
set @a=repeat(' ',9); |
|
1
by brian
clean slate |
224 |
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a)); |
225 |
select concat('*',v,'*',c,'*',t,'*') from t1; |
|
226 |
||
227 |
# Check how columns are copied |
|
228 |
show create table t1; |
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
229 |
create temporary table t2 like t1; |
1
by brian
clean slate |
230 |
show create table t2; |
1106.3.1
by Brian Aker
Heap is now tmp only table |
231 |
create temporary table t3 select * from t1; |
1
by brian
clean slate |
232 |
show create table t3; |
233 |
alter table t1 modify c varchar(10); |
|
234 |
show create table t1; |
|
235 |
alter table t1 modify v char(10); |
|
236 |
show create table t1; |
|
261.1.8
by Brian Aker
Merge from Harrison Fisk of the Ebay + Google Hash engine. |
237 |
alter table t1 modify t varchar(50); |
1
by brian
clean slate |
238 |
show create table t1; |
239 |
select concat('*',v,'*',c,'*',t,'*') from t1; |
|
240 |
drop table t1,t2,t3; |
|
241 |
||
242 |
#
|
|
243 |
# Testing of keys |
|
244 |
#
|
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
245 |
create temporary table t1 (v varchar(10), c char(10), t varchar(50), key(v), key(c), key(t(10))); |
1
by brian
clean slate |
246 |
show create table t1; |
247 |
disable_query_log; |
|
910.4.13
by Stewart Smith
batch up more INSERTs into transactions to help tests run quicker. |
248 |
begin; |
1
by brian
clean slate |
249 |
let $1=10; |
250 |
while ($1) |
|
251 |
{
|
|
252 |
let $2=27; |
|
253 |
eval set @space=repeat(' ',10-$1); |
|
254 |
while ($2) |
|
255 |
{
|
|
256 |
eval set @char=char(ascii('a')+$2-1); |
|
257 |
insert into t1 values(concat(@char,@space),concat(@char,@space),concat(@char,@space)); |
|
258 |
dec $2; |
|
259 |
}
|
|
260 |
dec $1; |
|
261 |
}
|
|
910.4.13
by Stewart Smith
batch up more INSERTs into transactions to help tests run quicker. |
262 |
commit; |
1
by brian
clean slate |
263 |
enable_query_log; |
264 |
select count(*) from t1; |
|
265 |
insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1))); |
|
266 |
select count(*) from t1 where v='a'; |
|
267 |
select count(*) from t1 where c='a'; |
|
268 |
select count(*) from t1 where t='a'; |
|
269 |
select count(*) from t1 where v='a '; |
|
270 |
select count(*) from t1 where c='a '; |
|
271 |
select count(*) from t1 where t='a '; |
|
272 |
select count(*) from t1 where v between 'a' and 'a '; |
|
273 |
select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; |
|
274 |
select count(*) from t1 where v like 'a%'; |
|
275 |
select count(*) from t1 where c like 'a%'; |
|
276 |
select count(*) from t1 where t like 'a%'; |
|
277 |
select count(*) from t1 where v like 'a %'; |
|
278 |
explain select count(*) from t1 where v='a '; |
|
279 |
explain select count(*) from t1 where c='a '; |
|
280 |
explain select count(*) from t1 where t='a '; |
|
281 |
explain select count(*) from t1 where v like 'a%'; |
|
282 |
explain select count(*) from t1 where v between 'a' and 'a '; |
|
283 |
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; |
|
284 |
||
285 |
--error ER_DUP_ENTRY
|
|
286 |
alter table t1 add unique(v); |
|
287 |
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); |
|
288 |
explain select * from t1 where v='a'; |
|
289 |
||
290 |
# GROUP BY |
|
291 |
||
292 |
select v,count(*) from t1 group by v limit 10; |
|
293 |
select v,count(t) from t1 group by v limit 10; |
|
294 |
select v,count(c) from t1 group by v limit 10; |
|
295 |
select sql_big_result trim(v),count(t) from t1 group by v limit 10; |
|
296 |
select sql_big_result trim(v),count(c) from t1 group by v limit 10; |
|
297 |
select c,count(*) from t1 group by c limit 10; |
|
298 |
select c,count(t) from t1 group by c limit 10; |
|
299 |
select t,count(*) from t1 group by t limit 10; |
|
300 |
select t,count(t) from t1 group by t limit 10; |
|
301 |
select sql_big_result trim(t),count(t) from t1 group by t limit 10; |
|
302 |
drop table t1; |
|
303 |
||
304 |
#
|
|
305 |
# Test unique keys |
|
306 |
#
|
|
307 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
308 |
create temporary table t1 (a char(10), unique (a)); |
1
by brian
clean slate |
309 |
insert into t1 values ('a'); |
310 |
--error ER_DUP_ENTRY
|
|
311 |
insert into t1 values ('a '); |
|
312 |
||
313 |
alter table t1 modify a varchar(10); |
|
314 |
--error ER_DUP_ENTRY
|
|
315 |
insert into t1 values ('a '),('a '),('a '),('a '); |
|
316 |
--error ER_DUP_ENTRY
|
|
317 |
insert into t1 values ('a '); |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
318 |
--error ER_DATA_TOO_LONG
|
1
by brian
clean slate |
319 |
insert into t1 values ('a '); |
320 |
--error ER_DUP_ENTRY
|
|
321 |
insert into t1 values ('a '); |
|
322 |
update t1 set a='a ' where a like 'a '; |
|
323 |
update t1 set a='a ' where a like 'a '; |
|
324 |
drop table t1; |
|
325 |
||
326 |
#
|
|
327 |
# Testing of btree keys |
|
328 |
#
|
|
329 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
330 |
create temporary table t1 (v varchar(10), c char(10), t varchar(50), key using btree (v), key using btree (c), key using btree (t(10))); |
1
by brian
clean slate |
331 |
show create table t1; |
332 |
disable_query_log; |
|
333 |
let $1=10; |
|
910.4.13
by Stewart Smith
batch up more INSERTs into transactions to help tests run quicker. |
334 |
begin; |
1
by brian
clean slate |
335 |
while ($1) |
336 |
{
|
|
337 |
let $2=27; |
|
338 |
eval set @space=repeat(' ',10-$1); |
|
339 |
while ($2) |
|
340 |
{
|
|
341 |
eval set @char=char(ascii('a')+$2-1); |
|
342 |
insert into t1 values(concat(@char,@space),concat(@char,@space),concat(@char,@space)); |
|
343 |
dec $2; |
|
344 |
}
|
|
345 |
dec $1; |
|
346 |
}
|
|
910.4.13
by Stewart Smith
batch up more INSERTs into transactions to help tests run quicker. |
347 |
commit; |
1
by brian
clean slate |
348 |
enable_query_log; |
349 |
select count(*) from t1; |
|
350 |
insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1))); |
|
351 |
select count(*) from t1 where v='a'; |
|
352 |
select count(*) from t1 where c='a'; |
|
353 |
select count(*) from t1 where t='a'; |
|
354 |
select count(*) from t1 where v='a '; |
|
355 |
select count(*) from t1 where c='a '; |
|
356 |
select count(*) from t1 where t='a '; |
|
357 |
select count(*) from t1 where v between 'a' and 'a '; |
|
358 |
--replace_column 9 #
|
|
359 |
select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; |
|
360 |
--replace_column 9 #
|
|
361 |
explain select count(*) from t1 where v='a '; |
|
362 |
--replace_column 9 #
|
|
363 |
explain select count(*) from t1 where c='a '; |
|
364 |
--replace_column 9 #
|
|
365 |
explain select count(*) from t1 where t='a '; |
|
366 |
--replace_column 9 #
|
|
367 |
explain select count(*) from t1 where v like 'a%'; |
|
368 |
--replace_column 9 #
|
|
369 |
explain select count(*) from t1 where v between 'a' and 'a '; |
|
370 |
--replace_column 9 #
|
|
371 |
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; |
|
372 |
||
373 |
--error ER_DUP_ENTRY
|
|
374 |
alter table t1 add unique(v); |
|
375 |
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); |
|
376 |
# Number of rows is not constant for b-trees keys |
|
377 |
--replace_column 9 #
|
|
378 |
explain select * from t1 where v='a'; |
|
379 |
||
380 |
drop table t1; |
|
381 |
||
382 |
#
|
|
383 |
# Test unique btree keys |
|
384 |
#
|
|
385 |
||
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
386 |
create temporary table t1 (a char(10), unique using btree (a)) engine=MEMORY; |
1
by brian
clean slate |
387 |
insert into t1 values ('a'); |
388 |
--error ER_DUP_ENTRY
|
|
389 |
insert into t1 values ('a '); |
|
390 |
||
391 |
alter table t1 modify a varchar(10); |
|
392 |
--error ER_DUP_ENTRY
|
|
393 |
insert into t1 values ('a '),('a '),('a '),('a '); |
|
394 |
--error ER_DUP_ENTRY
|
|
395 |
insert into t1 values ('a '); |
|
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
396 |
--error ER_DATA_TOO_LONG
|
1
by brian
clean slate |
397 |
insert into t1 values ('a '); |
398 |
--error ER_DUP_ENTRY
|
|
399 |
insert into t1 values ('a '); |
|
400 |
update t1 set a='a ' where a like 'a '; |
|
401 |
update t1 set a='a ' where a like 'a '; |
|
402 |
drop table t1; |
|
403 |
||
404 |
#
|
|
405 |
# test show create table |
|
406 |
#
|
|
407 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
408 |
create temporary table t1 (v varchar(10), c char(10), t varchar(50), key(v(5)), key(c(5)), key(t(5))); |
1
by brian
clean slate |
409 |
show create table t1; |
410 |
drop table t1; |
|
411 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
412 |
create temporary table t1 (v varchar(16383), key(v(10))); |
1
by brian
clean slate |
413 |
show create table t1; |
520.1.8
by Brian Aker
Updating tests. |
414 |
insert into t1 values(repeat('a',16383)); |
415 |
select length(v) from t1 where v=repeat('a',16383); |
|
1
by brian
clean slate |
416 |
drop table t1; |
417 |
||
418 |
#
|
|
419 |
# Reset varchar test |
|
420 |
#
|
|
421 |
eval set storage_engine=$default; |
|
422 |
||
423 |
#
|
|
424 |
# Bug #8489: Strange auto_increment behaviour |
|
425 |
#
|
|
426 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
427 |
create temporary table t1 (a bigint auto_increment primary key, b int, |
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
428 |
key (b, a)) engine=MEMORY; |
1
by brian
clean slate |
429 |
insert t1 (b) values (1),(1),(1),(1),(1),(1),(1),(1); |
430 |
select * from t1; |
|
431 |
drop table t1; |
|
432 |
||
1106.3.1
by Brian Aker
Heap is now tmp only table |
433 |
create temporary table t1 (a int not null, b int not null auto_increment, |
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
434 |
primary key(a, b), key(b)) engine=MEMORY; |
1
by brian
clean slate |
435 |
insert t1 (a) values (1),(1),(1),(1),(1),(1),(1),(1); |
436 |
select * from t1; |
|
437 |
drop table t1; |
|
438 |
||
1731.3.1
by Lee Bieber
change tests to use enum values instead of error numbers |
439 |
--error ER_WRONG_AUTO_KEY
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
440 |
create temporary table t1 (a int not null, b int not null auto_increment, |
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
441 |
primary key(a, b)) engine=MEMORY; |
1
by brian
clean slate |
442 |
|
443 |
#
|
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
444 |
# Bug #10566: Verify that we can create temporary a prefixed key with length > 255 |
1
by brian
clean slate |
445 |
#
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
446 |
create temporary table t1 (c char(255), primary key(c(90))); |
1
by brian
clean slate |
447 |
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); |
448 |
--error ER_DUP_ENTRY
|
|
449 |
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); |
|
450 |
drop table t1; |
|
451 |
||
452 |
#
|
|
453 |
# Bug 12796: Record doesn't show when selecting through index |
|
454 |
#
|
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
455 |
CREATE TEMPORARY TABLE t1 (a int, key(a)) engine=MEMORY;
|
1
by brian
clean slate |
456 |
insert into t1 values (0);
|
457 |
delete from t1;
|
|
458 |
select * from t1;
|
|
459 |
insert into t1 values (0), (1);
|
|
460 |
select * from t1 where a = 0;
|
|
461 |
drop table t1;
|
|
462 |
||
463 |
# End of 4.1 tests
|
|
464 |
||
465 |
#
|
|
466 |
# Bug #3094: Row format of memory tables should always be reported as Fixed
|
|
467 |
#
|
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
468 |
create temporary table t1 (c char(10)) engine=memory;
|
469 |
create temporary table t2 (c varchar(10)) engine=memory;
|
|
1320.1.18
by Brian Aker
Overhaul of SHOW TABLE STATUS. |
470 |
--replace_column 1 # 6 # 7 # 8 # 9 # 10 #
|
1
by brian
clean slate |
471 |
show table status like 't_'; |
472 |
drop table t1, t2;
|
|
473 |
||
474 |
#
|
|
475 |
# BUG#18233 - Memory tables INDEX USING HASH (a,b) returns 1 row on
|
|
476 |
# SELECT WHERE a= AND b=
|
|
477 |
#
|
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
478 |
CREATE TEMPORARY TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
|
1
by brian
clean slate |
479 |
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;
|
480 |
INSERT INTO t1 VALUES('a','aa',REPEAT('a', 256)),('a','aa',REPEAT('a',256)); |
|
481 |
SELECT COUNT(*) FROM t1 WHERE a='a'; |
|
482 |
SELECT COUNT(*) FROM t1 WHERE b='aa'; |
|
483 |
SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256); |
|
484 |
DROP TABLE t1;
|
|
485 |
||
486 |
# End of 5.0 tests
|
|
487 |
||
488 |
#
|
|
489 |
# BUG#26080 - Memory Storage engine not working properly
|
|
490 |
#
|
|
1106.3.1
by Brian Aker
Heap is now tmp only table |
491 |
CREATE TEMPORARY TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY;
|
1
by brian
clean slate |
492 |
INSERT INTO t1 VALUES('', 0); |
493 |
ALTER TABLE t1 MODIFY c1 VARCHAR(101); |
|
494 |
SELECT c2 FROM t1; |
|
495 |
DROP TABLE t1; |