1 # include/rowid_order.inc
3 # Test for rowid ordering (and comparison) functions.
4 # do index_merge select for tables with PK of various types.
7 # $engine_type -- storage engine to be tested
8 # has to be set before sourcing this script.
10 # Note: The comments/expections refer to InnoDB.
11 # They might be not valid for other storage engines.
14 # 2006-08-02 ML test refactored
15 # old name was t/rowid_order.test
16 # main code went into include/rowid_order.inc
19 eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
22 drop
table if exists t1, t2, t3,t4;
25 # Signed number as rowid
34 insert into t1 values (-5, 1, 1),
44 explain select * from t1 force
index(key1, key2) where key1 < 3 or key2 < 3;
45 select * from t1 force
index(key1, key2) where key1 < 3 or key2 < 3;
48 # Unsigned numbers as rowids
50 pk1
int unsigned not NULL,
57 insert into t1 values (0, 1, 1),
62 select * from t1 force
index(key1, key2) where key1 < 3 or key2 < 3;
65 # Case-insensitive char(N)
73 ) collate latin2_general_ci;
74 insert into t1 values ('a1', 1, 1),
78 select * from t1 force
index(key1, key2) where key1 < 3 or key2 < 3;
84 pk2
char(4) not NULL collate latin1_german1_ci,
85 pk3
char(4) not NULL collate latin1_bin,
88 PRIMARY
KEY (pk1,pk2,pk3),
94 (1,
'u', char(0xEC), 1, 1),
96 insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
97 insert ignore into t1 select pk1,
'x', pk3, key1, key2 from t1 where pk2=
'u';
98 insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
100 select * from t1 force
index(key1, key2) where key1 < 3 or key2 < 3;
103 alter
table t1 drop primary key;
105 select * from t1 force
index(key1, key2) where key1 < 3 or key2 < 3;
109 # this is also test for Bug#2688
111 pk1 varchar(8) NOT NULL
default '',
112 pk2 varchar(4) NOT NULL
default '',
115 primary key(pk1, pk2),
119 insert into t1 values (
'',
'empt',2,2),
124 select * from t1 force
index(key1, key2) where key1 < 3 or key2 < 3;