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

2.4 indexes can cause incorrect results with Infinity fields

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.4.9
    • Component/s: Index Maintenance, Querying
    • Major Change
    • ALL

      In 2.4 you can ensure an index and cause $gt/$gte queries to no longer match against infinity.

      2.4.9:

      > mydb.a.insert({_id: 0, a: Infinity})
      > mydb.a.find({a:{$gt: 1}})
      { "_id" : 0, "a" : Infinity }
      > mydb.a.ensureIndex({a:1})
      > mydb.a.find({a:{$gt: 1}})
      

      In 2.5.5-pre this is handled correctly:

      > db.a.insert({_id: 0, a: Infinity})
      > db.a.find({a:{$gt: 1}})
      { "_id" : 0, "a" : Infinity }
      > db.a.ensureIndex({a:1})
      > db.a.find({a:{$gt: 1}})
      { "_id" : 0, "a" : Infinity }
      

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            andrew.emil@10gen.com Andrew Emil (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: