Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17414

MyROCKS order desc limit 1 fails

    XMLWordPrintable

Details

    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)

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            hbaragar Henry Baragar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.