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 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),
39
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
40
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
43
# Unsigned numbers as rowids
52
insert into t1 values (0, 1, 1),
57
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
60
# Case-insensitive char(N)
68
) collate utf8_general_ci;
69
insert into t1 values ('a1', 1, 1),
73
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
80
pk3 char(4) not NULL collate utf8_bin,
83
PRIMARY KEY (pk1,pk2,pk3),
91
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
92
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
93
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
95
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
98
alter table t1 drop primary key;
100
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
104
# this is also test for Bug#2688
106
pk1 varchar(8) NOT NULL default '',
107
pk2 varchar(4) NOT NULL default '',
110
primary key(pk1, pk2),
114
insert into t1 values ('','empt',2,2),
119
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;