1
-- source include/have_innodb.inc
4
drop table if exists t1,t2,t3,t4;
7
set @save_storage_engine= @@storage_engine;
8
set storage_engine=InnoDB;
10
--source include/mrr_tests.inc
12
set storage_engine= @save_storage_engine;
13
drop table t1, t2, t3, t4;
16
set @read_rnd_buffer_size_save= @@read_rnd_buffer_size;
17
set read_rnd_buffer_size=64;
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;
28
concat('a-', 1000 + A.a, '-a'),
29
concat('b-', 1000 + B.a, '-b'),
30
concat('c-', 1000 + C.a, '-c'),
32
from t1 A, t1 B, t1 C;
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';
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;
47
set @@read_rnd_buffer_size= @read_rnd_buffer_size_save;
50
# BUG#33033 "MySQL/InnoDB crashes with simple select range query"
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;
59
eval insert into t1(f1,f2,f3,f4) values ($1,$1,$1,'A');
64
# The following must not crash:
65
select * from t1 where (f3>=5 and f3<=10) or (f3>=1 and f3<=4);