2
# Test heap tables with variable-sized records.
6
drop table if exists t1;
9
set @@session.max_heap_table_size=16*1024*1024;
12
create table t1 (a int not null, b varchar(400), c int, primary key (a), key (c)) engine=heap comment="testing heaps" block_size=128;
15
create table t1 (a int not null, b int, c varchar(400), primary key (a), key (b)) engine=heap comment="testing heaps" block_size=4;
17
create table t1 (a int not null, b int, c varchar(400), d varchar(400), primary key (a), key (b)) engine=heap comment="testing heaps" block_size=24;
19
#show table status like "t1";
21
insert into t1 values (1,1,'012',NULL), (2,2,'0123456789',NULL), (3,3,'012345678901234567890123456789',NULL), (4,4,NULL,'0123456789012345678901234567890123456789012345678901234567890123456789');
24
delete from t1 where a = 3;
27
insert into t1 values (5,5,NULL,'0123'), (6,6,NULL,'0123');
30
update t1 set c = '012345678901234567890123456789' where a = 2;
33
update t1 set c = '0123456789' where a = 2;
36
insert into t1 values (7,7,'0123',NULL), (8,8,'0123',NULL);
39
#show table status like "t1";
40
alter table t1 block_size = 0;
41
#show table status like "t1";
42
alter table t1 row_format = dynamic;
43
#show table status like "t1";
44
alter table t1 block_size = 128, max_rows = 10001;
45
#show table status like "t1";
2
# Test heap tables with variable-sized records.
6
drop table if exists t1;
9
set @@session.max_heap_table_size=16*1024*1024;
12
create table t1 (a int not null, b varchar(400), c int, primary key (a), key (c)) engine=heap comment="testing heaps" block_size=128;
15
create table t1 (a int not null, b int, c varchar(400), primary key (a), key (b)) engine=heap comment="testing heaps" block_size=4;
17
create table t1 (a int not null, b int, c varchar(400), d varchar(400), primary key (a), key (b)) engine=heap comment="testing heaps" block_size=24;
19
#show table status like "t1";
21
insert into t1 values (1,1,'012',NULL), (2,2,'0123456789',NULL), (3,3,'012345678901234567890123456789',NULL), (4,4,NULL,'0123456789012345678901234567890123456789012345678901234567890123456789');
24
delete from t1 where a = 3;
27
insert into t1 values (5,5,NULL,'0123'), (6,6,NULL,'0123');
30
update t1 set c = '012345678901234567890123456789' where a = 2;
33
update t1 set c = '0123456789' where a = 2;
36
insert into t1 values (7,7,'0123',NULL), (8,8,'0123',NULL);
39
#show table status like "t1";
40
alter table t1 block_size = 0;
41
#show table status like "t1";
42
alter table t1 row_format = dynamic;
43
#show table status like "t1";
44
alter table t1 block_size = 128, max_rows = 10001;
45
#show table status like "t1";
59
59
eval insert into t1 values ($1,$1,$1,$1);
66
select count(*) from t1;
69
insert into t1 values (100000,100000,NULL,'0123'), (100000,100000,NULL,'0123');
71
#show table status like "t1";
72
select count(*) from t1;
74
set @@session.max_heap_table_size=default;
66
select count(*) from t1;
69
insert into t1 values (100000,100000,NULL,'0123'), (100000,100000,NULL,'0123');
71
#show table status like "t1";
72
select count(*) from t1;
74
set @@session.max_heap_table_size=default;