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

Equality to null predicate misses undefined values when answered via the prefix of a text index

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 3.0.12, 3.3.10
    • Fix Version/s: Backlog
    • Component/s: Querying
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      for(x=0;x<1000;x++){db.foo.insert({"x":x, y:undefined} )}
      db.foo.ensureIndex({y:1})
      a = db.foo.find({y:null}).hint({y:1}).count()
      b = db.foo.find({y:null}).hint({_id:1}).count()
      assert.eq(a, b)
      

      Show
      for(x=0;x<1000;x++){db.foo.insert({"x":x, y:undefined} )} db.foo.ensureIndex({y:1}) a = db.foo.find({y:null}).hint({y:1}).count() b = db.foo.find({y:null}).hint({_id:1}).count() assert.eq(a, b)

      Description

      When querying for null on a field fully covered by an index, documents that have undefined as a value will be skipped. This is not true when doing a collection scan.

      Looks to affect all of the 3.X family at time of report (pre 3.4).

        Attachments

          Activity

            People

            Assignee:
            backlog-query-execution Backlog - Query Execution
            Reporter:
            david.hows David Hows
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated: