~ubuntu-branches/ubuntu/trusty/drizzle/trusty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
drop table if exists t1;
set @@session.max_heap_table_size=16*1024*1024*24;
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";
show table status like "t1";
Session	Schema	Name	Type	Engine	Version	Rows	Avg_row_length	Table_size	Auto_increment
#	test	t1	TEMPORARY	MEMORY	#	#	#	#	#
insert into t1 values (1,1,'012',NULL), (2,2,'0123456789',NULL), (3,3,'012345678901234567890123456789',NULL), (4,4,NULL,'0123456789012345678901234567890123456789012345678901234567890123456789');
select * from t1;
a	b	c	d
1	1	012	NULL
2	2	0123456789	NULL
3	3	012345678901234567890123456789	NULL
4	4	NULL	0123456789012345678901234567890123456789012345678901234567890123456789
delete from t1 where a = 3;
select * from t1;
a	b	c	d
1	1	012	NULL
2	2	0123456789	NULL
4	4	NULL	0123456789012345678901234567890123456789012345678901234567890123456789
insert into t1 values (5,5,NULL,'0123'), (6,6,NULL,'0123');
select * from t1;
a	b	c	d
1	1	012	NULL
2	2	0123456789	NULL
5	5	NULL	0123
4	4	NULL	0123456789012345678901234567890123456789012345678901234567890123456789
6	6	NULL	0123
update t1 set c = '012345678901234567890123456789' where a = 2;
select * from t1;
a	b	c	d
1	1	012	NULL
2	2	012345678901234567890123456789	NULL
5	5	NULL	0123
4	4	NULL	0123456789012345678901234567890123456789012345678901234567890123456789
6	6	NULL	0123
update t1 set c = '0123456789' where a = 2;
select * from t1;
a	b	c	d
1	1	012	NULL
2	2	0123456789	NULL
5	5	NULL	0123
4	4	NULL	0123456789012345678901234567890123456789012345678901234567890123456789
6	6	NULL	0123
insert into t1 values (7,7,'0123',NULL), (8,8,'0123',NULL);
select * from t1;
a	b	c	d
1	1	012	NULL
2	2	0123456789	NULL
5	5	NULL	0123
4	4	NULL	0123456789012345678901234567890123456789012345678901234567890123456789
6	6	NULL	0123
7	7	0123	NULL
8	8	0123	NULL
delete from t1;
select * from t1;
a	b	c	d
select count(*) from t1;
count(*)
10001
insert into t1 values (100000,100000,NULL,'0123'), (100000,100000,NULL,'0123');
ERROR 23000: Duplicate entry '100000' for key 'PRIMARY'
show table status like "t1";
Session	Schema	Name	Type	Engine	Version	Rows	Avg_row_length	Table_size	Auto_increment
#	test	t1	TEMPORARY	MEMORY	#	#	#	#	#
select count(*) from t1;
count(*)
10002
set @@session.max_heap_table_size=default;
drop table t1;