File: range_innodb.test

package info (click to toggle)
mariadb-10.0 10.0.32-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 476,064 kB
  • sloc: cpp: 1,400,131; ansic: 832,140; perl: 54,391; sh: 41,304; pascal: 32,365; yacc: 14,921; xml: 5,257; sql: 4,667; cs: 4,647; makefile: 4,555; ruby: 4,465; python: 2,292; lex: 1,427; java: 941; asm: 295; awk: 54; php: 22; sed: 16
file content (47 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (3)
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
--echo #
--echo # Range optimizer (and related) tests that need InnoDB.
--echo # 

--source include/have_innodb.inc

--disable_warnings
drop table if exists t0, t1, t2;
--enable_warnings

--echo #
--echo # MDEV-6735: Range checked for each record used with key
--echo #

create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);

create table t1(a int);
insert into t1 select A.a + B.a* 10 + C.a * 100 + D.a * 1000
from t0 A, t0 B, t0 C, t0 D;

create table t2 ( 
 a int,
 b int,
 filler1 char(100),
 filler2 char(100),
 filler3 char(100),
 filler4 char(100),
 key(a),
 key(b)
) engine=innodb;

insert into t2 
select 
   a,a,
  repeat('0123456789', 10), 
  repeat('0123456789', 10), 
  repeat('0123456789', 10),
  repeat('0123456789', 10)
from t1;

analyze table t2;
--echo # The following must not use "Range checked for each record":
explain select * from t0 left join t2 on t2.a <t0.a and t2.b between 50 and 250;

drop table t0,t1,t2;