1
SET SESSION STORAGE_ENGINE = InnoDB;
2
drop table if exists t1, t2, t3,t4;
11
insert into t1 values (-5, 1, 1),
16
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
17
id select_type table type possible_keys key key_len ref rows Extra
18
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 4 Using sort_union(key1,key2); Using where
19
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
35
insert into t1 values (0, 1, 1),
40
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
55
) collate utf8_general_ci;
56
insert into t1 values ('a1', 1, 1),
60
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
70
pk3 char(4) not NULL collate utf8_bin,
73
PRIMARY KEY (pk1,pk2,pk3),
81
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
83
Warning 1366 Incorrect string value: '\xEC' for column 'pk2' at row 1
84
Warning 1366 Incorrect string value: '\xEC' for column 'pk2' at row 2
85
Warning 1366 Incorrect string value: '\xEC' for column 'pk2' at row 3
86
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
87
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
108
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
109
pk1 pk2 pk3 key1 key2
128
alter table t1 drop primary key;
130
pk1 pk2 pk3 key1 key2
149
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
150
pk1 pk2 pk3 key1 key2
171
pk1 varchar(8) NOT NULL default '',
172
pk2 varchar(4) NOT NULL default '',
175
primary key(pk1, pk2),
179
insert into t1 values ('','empt',2,2),
184
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;