1
1
drop table if exists t1;
2
set @@session.max_heap_table_size=16*1024*1024*24;
3
create temporary table t1 (a int not null, b int, c varchar(400), d varchar(400), primary key (a), key (b)) engine=MEMORY comment="testing heaps";
2
set @@session.max_heap_table_size=16*1024*1024;
3
create temporary table t1 (a int not null, b varchar(400), c int, primary key (a), key (c)) engine=MEMORY comment="testing heaps" block_size=128;
4
ERROR 42000: Incorrect usage/placement of 'block_size'
5
create temporary table t1 (a int not null, b int, c varchar(400), primary key (a), key (b)) engine=MEMORY comment="testing heaps" block_size=4;
6
ERROR 42000: Incorrect usage/placement of 'block_size'
7
create temporary table t1 (a int not null, b int, c varchar(400), d varchar(400), primary key (a), key (b)) engine=MEMORY comment="testing heaps" block_size=24;
4
8
show table status like "t1";
5
9
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
6
10
# test t1 TEMPORARY MEMORY # # # # #
24
28
2 2 0123456789 NULL
26
31
4 4 NULL 0123456789012345678901234567890123456789012345678901234567890123456789
28
32
update t1 set c = '012345678901234567890123456789' where a = 2;
32
36
2 2 012345678901234567890123456789 NULL
34
39
4 4 NULL 0123456789012345678901234567890123456789012345678901234567890123456789
36
40
update t1 set c = '0123456789' where a = 2;
40
44
2 2 0123456789 NULL
42
47
4 4 NULL 0123456789012345678901234567890123456789012345678901234567890123456789
44
48
insert into t1 values (7,7,'0123',NULL), (8,8,'0123',NULL);
48
52
2 2 0123456789 NULL
50
4 4 NULL 0123456789012345678901234567890123456789012345678901234567890123456789
55
4 4 NULL 0123456789012345678901234567890123456789012345678901234567890123456789
58
show table status like "t1";
59
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
60
# test t1 TEMPORARY MEMORY # # # # #
61
alter table t1 block_size = 0;
62
show table status like "t1";
63
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
64
# test t1 TEMPORARY MEMORY # # # # #
65
alter table t1 row_format = dynamic;
66
show table status like "t1";
67
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
68
# test t1 TEMPORARY MEMORY # # # # #
69
alter table t1 block_size = 128;
70
show table status like "t1";
71
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
72
# test t1 TEMPORARY MEMORY # # # # #
79
4 4 NULL 0123456789012345678901234567890123456789012345678901234567890123456789