~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/heap_var.result

  • Committer: Padraig O'Sullivan
  • Date: 2009-07-22 23:26:26 UTC
  • mto: (1039.5.43 replication)
  • mto: This revision was merged to the branch mainline in revision 1130.
  • Revision ID: osullivan.padraig@gmail.com-20090722232626-mu4khq7ho6dqcf7q
Created a simple filtered replicator that can filter by schema name or table
name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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";
4
 
show table status like "t1";
5
 
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
6
 
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
 
2
set @@session.max_heap_table_size=16*1024*1024;
 
3
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;
 
4
ERROR 42000: Incorrect usage/placement of 'block_size'
 
5
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;
 
6
ERROR 42000: Incorrect usage/placement of 'block_size'
 
7
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;
7
8
insert into t1 values (1,1,'012',NULL), (2,2,'0123456789',NULL), (3,3,'012345678901234567890123456789',NULL), (4,4,NULL,'0123456789012345678901234567890123456789012345678901234567890123456789');
8
9
select * from t1;
9
10
a       b       c       d
22
23
a       b       c       d
23
24
1       1       012     NULL
24
25
2       2       0123456789      NULL
 
26
6       6       NULL    0123
25
27
5       5       NULL    0123
26
28
4       4       NULL    0123456789012345678901234567890123456789012345678901234567890123456789
27
 
6       6       NULL    0123
28
29
update t1 set c = '012345678901234567890123456789' where a = 2;
29
30
select * from t1;
30
31
a       b       c       d
31
32
1       1       012     NULL
32
33
2       2       012345678901234567890123456789  NULL
 
34
6       6       NULL    0123
33
35
5       5       NULL    0123
34
36
4       4       NULL    0123456789012345678901234567890123456789012345678901234567890123456789
35
 
6       6       NULL    0123
36
37
update t1 set c = '0123456789' where a = 2;
37
38
select * from t1;
38
39
a       b       c       d
39
40
1       1       012     NULL
40
41
2       2       0123456789      NULL
 
42
6       6       NULL    0123
41
43
5       5       NULL    0123
42
44
4       4       NULL    0123456789012345678901234567890123456789012345678901234567890123456789
43
 
6       6       NULL    0123
44
45
insert into t1 values (7,7,'0123',NULL), (8,8,'0123',NULL);
45
46
select * from t1;
46
47
a       b       c       d
47
48
1       1       012     NULL
48
49
2       2       0123456789      NULL
49
 
5       5       NULL    0123
50
 
4       4       NULL    0123456789012345678901234567890123456789012345678901234567890123456789
51
 
6       6       NULL    0123
 
50
6       6       NULL    0123
 
51
5       5       NULL    0123
 
52
4       4       NULL    0123456789012345678901234567890123456789012345678901234567890123456789
 
53
7       7       0123    NULL
 
54
8       8       0123    NULL
 
55
alter table t1 block_size = 0;
 
56
alter table t1 row_format = dynamic;
 
57
alter table t1 block_size = 128, max_rows = 10001;
 
58
select * from t1;
 
59
a       b       c       d
 
60
1       1       012     NULL
 
61
2       2       0123456789      NULL
 
62
6       6       NULL    0123
 
63
5       5       NULL    0123
 
64
4       4       NULL    0123456789012345678901234567890123456789012345678901234567890123456789
52
65
7       7       0123    NULL
53
66
8       8       0123    NULL
54
67
delete from t1;
58
71
count(*)
59
72
10001
60
73
insert into t1 values (100000,100000,NULL,'0123'), (100000,100000,NULL,'0123');
61
 
ERROR 23000: Duplicate entry '100000' for key 'PRIMARY'
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  #       #       #       #       #
 
74
ERROR HY000: The table 't1' is full
65
75
select count(*) from t1;
66
76
count(*)
67
 
10002
 
77
10001
68
78
set @@session.max_heap_table_size=default;
69
79
drop table t1;