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

An $or query with children which are all trivially false incorrectly optimizes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.7.7
    • Fix Version/s: 3.6.5, 4.0.0-rc0
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Sprint:
      Query 2018-05-07
    • Linked BF Score:
      45

      Description

      A query such as the following will never match any documents:

      // {a: {$all: []}} will never match.
      db.foo.find({$or: [{a: {$all: []}}]});
      

      The server will incorrectly optimize that query which can lead to an bug in planning.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              charlie.swanson Charlie Swanson
              Reporter:
              charlie.swanson Charlie Swanson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: