~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
-- source include/have_innodb.inc
2
3
--disable_warnings
4
drop table if exists t1,t2,t3,t4;
5
--enable_warnings
6
7
set @save_storage_engine= @@storage_engine;
8
set storage_engine=InnoDB;
9
10
--source include/mrr_tests.inc 
11
12
set storage_engine= @save_storage_engine;
13
drop table t1, t2, t3, t4;
14
15
# Try big rowid sizes
16
set @read_rnd_buffer_size_save= @@read_rnd_buffer_size;
17
set read_rnd_buffer_size=64;
18
19
20
# By default InnoDB will fill values only for key parts used by the query,
21
# which will cause DS-MRR to supply an invalid tuple on scan restoration. 
22
# Verify that DS-MRR's code extra(HA_EXTRA_RETRIEVE_ALL_COLS) call has effect:
23
create table t1(a int);
24
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
25
create table t2(a char(8), b char(8), c char(8), filler char(100), key(a,b,c) ) engine=InnoDB;
26
27
insert into t2 select 
28
  concat('a-', 1000 + A.a, '-a'),
29
  concat('b-', 1000 + B.a, '-b'),
30
  concat('c-', 1000 + C.a, '-c'),
31
  'filler'
32
from t1 A, t1 B, t1 C;
33
34
explain
35
select count(length(a) + length(filler)) from t2 where a>='a-1000-a' and a <'a-1001-a';
36
select count(length(a) + length(filler)) from t2 where a>='a-1000-a' and a <'a-1001-a';
37
drop table t2;
38
39
# Try a very big rowid
40
create table t2 (a char(100), b char(100), c char(100), d int, 
41
                 filler char(10), key(d), primary key (a,b,c)) engine= innodb;
42
insert into t2 select A.a, B.a, B.a, A.a, 'filler' from t1 A, t1 B;
43
explain select * from t2 force index (d) where d < 10;
44
drop table t2;
45
46
drop table t1;
47
set @@read_rnd_buffer_size= @read_rnd_buffer_size_save;
48
49
#
50
# BUG#33033 "MySQL/InnoDB crashes with simple select range query"
51
#
52
create table t1 (f1 int not null, f2 int not null,f3 int not null, f4 char(1), primary key (f1,f2), key ix(f3))Engine=InnoDB;
53
54
--disable_query_log
55
let $1=55;
56
57
while ($1)
58
{
59
  eval insert into t1(f1,f2,f3,f4) values ($1,$1,$1,'A');
60
  dec $1;
61
}
62
--enable_query_log
63
64
# The following must not crash:
65
select * from t1 where (f3>=5 and f3<=10) or (f3>=1 and f3<=4);
66
67
drop table t1;
68