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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 6.1.0-rc0
    • None
    • None
    • Fully Compatible
    • ALL
    • QO 2022-07-11, QO 2022-07-25, QO 2022-08-08

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: