[SERVER-9277] Ranged index bounds do not permit retrieving Infinity or -Infinity Created: 08/Apr/13 Updated: 11/Jul/16 Resolved: 04/Dec/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Querying |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Antonio Angelino | Assignee: | Benety Goh |
| Resolution: | Done | Votes: | 1 |
| Labels: | query_triage | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
GNU/Linux Debian 6 x64, |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Querying on an indexed field which contains Infinity and -Infinity does not produce expected results when using range predicates. Note the upper bound on the second query is equal to max double value, which compares as less than infinity. If you do an equality search, it will use the index just fine. Here's an example with explain output.
|
| Comments |
| Comment by Antonio Angelino [ 22/Apr/13 ] | |||||||||||||||||||||||||||||||||
|
Hello, any news here? The bug still persist and the only way to query the database and fetch the right documents is to add an or in each query instead of a simple $gte statement... Kind Regards, | |||||||||||||||||||||||||||||||||
| Comment by Antonio Angelino [ 09/Apr/13 ] | |||||||||||||||||||||||||||||||||
|
Hello All, if you add an index on the field, you can reproduce the issue. db.foo.ensureIndex( {x: 1}) Kind Regards, | |||||||||||||||||||||||||||||||||
| Comment by Randolph Tan [ 09/Apr/13 ] | |||||||||||||||||||||||||||||||||
|
Was able to reproduce in master (commit cc155a6fb38cb8509047e772187f23bd44bb7cb4) only if you pass sort( { x: 1 }) to the query. Setup: index only on _id field. Example shell session:
| |||||||||||||||||||||||||||||||||
| Comment by Jeremy Mikola [ 09/Apr/13 ] | |||||||||||||||||||||||||||||||||
|
Antonio, I cannot reproduce this:
|