1# include/index_merge_2sweeps.inc
2#
3# 2-sweeps read Index_merge test
4#
5# Last update:
6# 2006-08-02 ML test refactored
7#               old name was index_merge_innodb2.test
8#               main code went into include/index_merge_2sweeps.inc
9#
10--source include/have_sequence.inc
11
12--echo #---------------- 2-sweeps read Index merge test 2 -------------------------------
13
14create table t1 (
15  pk int primary key,
16  key1 int,
17  key2 int,
18  filler char(200),
19  filler2 char(200),
20  index(key1),
21  index(key2)
22);
23
24insert into t1 select seq, seq, seq, 'filler-data', 'filler-data-2'
25from seq_1000_to_1;
26
27select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
28
29set @maxv=1000;
30
31select * from t1 where
32  (pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
33  or key1=18 or key1=60;
34
35select * from t1 where
36  (pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
37  or key1 < 3 or key1 > @maxv-11;
38
39select * from t1 where
40  (pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
41  or
42  (key1 < 5) or (key1 > 10 and key1 < 15) or (key1 >= 50 and key1 < 55 ) or (key1 > @maxv-10);
43
44select * from t1 where
45  (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 )
46  or
47  (key1 < 5) or (key1 > @maxv-10);
48
49drop table t1;
50