blob: a925c21e18879ee87d015f2ef539fe1fc1301b88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
create table t1 (id1 bigint, id2 bigint, c1 bigint, c2 bigint, c3 bigint, c4 bigint, c5 bigint, c6 bigint, c7 bigint, primary key (id1, id2), index i(c1, c2));
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
select count(*) from t1;
count(*)
10000
explain select c1 from t1 where c1 > 5 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range i i 9 NULL # Using where; Using index
drop table t1;
#
# MDEV-17414: MyROCKS order desc limit 1 fails
#
create table t1 (date date);
insert into t1 values ('2018-10-04'), ('2018-10-05');
select * from t1 where date < '2018-10-09' order by date desc limit 1;
date
2018-10-05
alter table t1 add index date_index (date);
select * from t1 where date < '2018-10-05' order by date desc limit 1;
date
2018-10-04
# this should not produce an empty set:
select * from t1 where date < '2018-10-09' order by date desc limit 1;
date
2018-10-05
drop table t1;
|