~drizzle-trunk/drizzle/development

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
70
71
72
73
74
75
76
77
78
#
# Test heap tables with variable-sized records.
#

--disable_warnings
drop table if exists t1;
--enable_warnings

set @@session.max_heap_table_size=16*1024*1024;

--error 1234
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;

--error 1234
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;

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;

#show table status like "t1";

insert into t1 values (1,1,'012',NULL), (2,2,'0123456789',NULL), (3,3,'012345678901234567890123456789',NULL), (4,4,NULL,'0123456789012345678901234567890123456789012345678901234567890123456789');
select * from t1;

delete from t1 where a = 3;
select * from t1;

insert into t1 values (5,5,NULL,'0123'), (6,6,NULL,'0123');
select * from t1;

update t1 set c = '012345678901234567890123456789' where a = 2;
select * from t1;

update t1 set c = '0123456789' where a = 2;
select * from t1;

insert into t1 values (7,7,'0123',NULL), (8,8,'0123',NULL);
select * from t1;

#show table status like "t1";
alter table t1 block_size = 0;
#show table status like "t1";
alter table t1 row_format = dynamic;
#show table status like "t1";
alter table t1 block_size = 128, max_rows = 10001;
#show table status like "t1";

select * from t1;

delete from t1;
select * from t1;

let $1=10001;

disable_query_log;

while ($1) 
{

  eval insert into t1 values ($1,$1,$1,$1);

  dec $1;

}
enable_query_log;

select count(*) from t1;

--error 1114
insert into t1 values (100000,100000,NULL,'0123'), (100000,100000,NULL,'0123');

#show table status like "t1";
select count(*) from t1;

set @@session.max_heap_table_size=default;

drop table t1;

# End of 5.0 tests