[SERVER-12511] 2.4 indexes can cause incorrect results with Infinity fields Created: 28/Jan/14  Updated: 10/Dec/14  Resolved: 29/Jan/14

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Querying
Affects Version/s: 2.4.9
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Andrew Emil (Inactive) Assignee: Benety Goh
Resolution: Duplicate Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-11617 Sorting with value of Infinity causes... Closed
Related
Backwards Compatibility: Major Change
Operating System: ALL
Participants:

 Description   

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 }


Generated at Thu Feb 08 03:28:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.