~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/heap_hash.test

Merge Stewart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
create temporary table t1 (a int not null,b int not null, primary key using HASH (a)) engine=MEMORY comment="testing heaps";
10
10
insert into t1 values(1,1),(2,2),(3,3),(4,4);
11
11
delete from t1 where a=1 or a=0;
12
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
13
 
show table status like "t1";
 
12
#show table status like "t1";
14
13
show keys from t1;
15
14
select * from t1;
16
15
select * from t1 where a=4;
18
17
update t1 set b=b+1 where a>=3;
19
18
replace t1 values (3,3);
20
19
select * from t1;
21
 
alter table t1 add c int DEFAULT 42 not null, add key using HASH (c,a);
 
20
alter table t1 add c int not null, add key using HASH (c,a);
22
21
drop table t1;
23
22
 
24
23
create temporary table t1 (a int not null,b int not null, primary key using HASH (a)) engine=MEMORY comment="testing heaps";
30
29
create temporary table t1 (a int not null,b int not null, primary key using HASH (a)) engine=MEMORY comment="testing heaps";
31
30
insert into t1 values(1,1),(2,2),(3,3),(4,4);
32
31
alter table t1 modify a int not null auto_increment, engine=innodb, comment="new innodb table";
33
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
34
 
show table status like "t1";
 
32
#show table status like "t1";
35
33
select * from t1;
36
34
drop table t1;
37
35
 
51
49
engine=MEMORY;
52
50
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
53
51
select * from t1 where x=1;
54
 
--error ER_CANT_REOPEN_TABLE
 
52
-- error 1137
55
53
select * from t1,t1 as t2 where t1.x=t2.y;
56
 
--error ER_CANT_REOPEN_TABLE
 
54
-- error 1137
57
55
explain select * from t1,t1 as t2 where t1.x=t2.y;
58
56
drop table t1;
59
57
 
108
106
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
109
107
explain select * from t1 where btn like "q%";
110
108
select * from t1 where btn like "q%";
111
 
alter table t1 add column new_col char(1) default "Y" not null, add key using HASH (btn,new_col), drop key btn;
 
109
alter table t1 add column new_col char(1) not null, add key using HASH (btn,new_col), drop key btn;
112
110
update t1 set new_col=left(btn,1);
113
111
explain select * from t1 where btn="a";
114
112
explain select * from t1 where btn="a" and new_col="a";
171
169
explain select * from t1 where a='aaab';
172
170
explain select * from t1 where a='aaac';
173
171
explain select * from t1 where a='aaad';
174
 
--error ER_CANT_REOPEN_TABLE
 
172
-- error 1137
175
173
insert into t1 select * from t1;
176
174
 
177
175
# avoid statistics differences between normal and ps-protocol tests