Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-67510

[CQF] Query using range predicate on descending index does not return correct results

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • QO 2022-07-11, QO 2022-07-25, QO 2022-08-08

      This bug is related to CQF/bonsai only.

      coll.insertOne({a: 1});
      coll.createIndex({a: -1});
      const res = coll.find({a : {$gte: 0, $lte: 2}}).toArray();
      

      The query above should always return the one document but instead sometimes returns nothing, dependent on which plan is chosen and if the index is used. Note that if

      for (i = 0; i < 100; ++i) coll.insert({}) 

      is added, a plan using the descending index will always be chosen, and the query will return no results.

            Assignee:
            daniel.segel@mongodb.com Daniel Segel
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: