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

    • Query Integration
    • ALL
    • 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)

      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).

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            david.hows David Hows
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: