mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / include / index_merge_2sweeps.inc
blob3ae7e5b3c0905f215ff5d72f5e4a18b36b10932c
1 # include/index_merge_2sweeps.inc
3 # 2-sweeps read Index_merge test
5 # The variable
6 #     $engine_type       -- storage engine to be tested
7 # has to be set before sourcing this script.
9 # Last update:
10 # 2006-08-02 ML test refactored
11 #               old name was index_merge_innodb2.test
12 #               main code went into include/index_merge_2sweeps.inc
15 --echo #---------------- 2-sweeps read Index merge test 2 -------------------------------
17 eval SET SESSION STORAGE_ENGINE = $engine_type;
19 --disable_warnings
20 drop table if exists t1;
21 --enable_warnings
23 create table t1 (
24   pk int primary key,
25   key1 int,
26   key2 int,
27   filler char(200),
28   filler2 char(200),
29   index(key1),
30   index(key2)
34 --disable_query_log
35 let $1=1000;
36 while ($1)
38   eval insert into t1 values($1, $1, $1, 'filler-data','filler-data-2');
39   dec $1;
41 --enable_query_log
43 select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
45 set @maxv=1000;
47 select * from t1 where
48   (pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
49   or key1=18 or key1=60;
51 select * from t1 where
52   (pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
53   or key1 < 3 or key1 > @maxv-11;
55 select * from t1 where
56   (pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
57   or
58   (key1 < 5) or (key1 > 10 and key1 < 15) or (key1 >= 50 and key1 < 55 ) or (key1 > @maxv-10);
60 select * from t1 where
61   (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 )
62   or
63   (key1 < 5) or (key1 > @maxv-10);
65 drop table t1;