Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.3.10, 10.2(EOL), 10.3(EOL)
-
None
-
Ubuntu 18.04.1 LTS
Description
select * from days where date < '2018-10-09' order by date desc limit 1
fails if there is an index on date and a record for 2018-10-09 does not exist in the table.
To recreate ....
create table days (date date);
insert into days values ('2018-10-04'), ('2018-10-05');
select * from days where date < '2018-10-09' order by date desc limit 1; # Works as expected
alter table days add index date_index (date);
select * from days where date < '2018-10-05' order by date desc limit 1; # Works as expected
select * from days where date < '2018-10-09' order by date desc limit 1; # FAILS: Empty set (0.001 sec)