[SERVER-24920] Value::integral() incorrectly returns true for Decimal128(2.3) Created: 06/Jul/16 Updated: 19/Nov/16 Resolved: 08/Sep/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 3.3.14 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Samuel Rossi (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Integration 2016-09-19 |
| Participants: |
| Description |
|
Value::integral() is meant to return true only if it is a numeric value, which has no additional decimal places, and can be represented in 32 bits, e.g. 2, 2.0, or Decimal(2.0), but not (1LL << 42), 2.3, or Decimal128(2.3). This impacts expressions which require integral arguments, such as $arrayElemAt:
I think this can be fixed by simply switching this line to use toIntExact() instead of toInt(). |
| Comments |
| Comment by Githook User [ 08/Sep/16 ] |
|
Author: {u'name': u'Sam Rossi', u'email': u'sam.rossi@mongodb.com'}Message: |