[SERVER-7446] $inc should handle negative overflow the same as positive overflow Created: 23/Oct/12 Updated: 11/Jul/16 Resolved: 19/Aug/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.2 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 5 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Description |
|
Right now if $inc would cause two positive ints to overflow, the result is converted to a long to prevent overflow. However, if two negative ints are added the result may overflow to a negative int. Test
|
| Comments |
| Comment by auto [ 19/Aug/13 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}Message: |
| Comment by Andrew Morrow (Inactive) [ 19/Jul/13 ] |
|
Hi - We are currently working on changes to the update code path that will address this issue for 2.5, and we will evaluate fixing on earlier releases as well. Thanks, |
| Comment by Luciano Issoe [ 19/Jul/13 ] |
|
This is a serious BUG and should be fixed back to 2.2 and 2.4 branches!!!! |
| Comment by Giuliano Caliari [ 19/Jul/13 ] |
|
I agree with Flavio. We had a major problem in several user accounts because of this overflow. |
| Comment by Flavio da Silva Mori Junior [ 18/Jul/13 ] |
|
Please upgrade the type to BUG and priority to Critical P2, because this issue can cause data loss. |