[SERVER-62888] $multiply in SBE promotes integer to decimal type on overflow Created: 21/Jan/22 Updated: 29/Oct/23 Resolved: 26/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0, 7.0.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Irina Yatsenko (Inactive) | Assignee: | Ivan Fefer |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 7.1-Type-Precision-Fixes | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v7.0
|
||||||||||||
| Sprint: | QE 2022-02-07, QE 2022-02-21 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 35 | ||||||||||||
| Description |
|
Currently, in SBE we promote integer types to decimal on overflow, while in the classical engine we promote to double. There are arguments to support either of the behaviors as well as arguments to never promote. Waiting for a spec (ksuarz@gmail.com) that would describe what should be done on integer overflow in $add, $subtract, $mulitple, $inc, $sum et al. |
| Comments |
| Comment by Githook User [ 28/Apr/23 ] |
|
Author: {'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}Message: |
| Comment by Githook User [ 26/Apr/23 ] |
|
Author: {'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}Message: |
| Comment by Rushan Chen [ 05/Apr/23 ] |
|
As agreed in discussion and documented in WRITING-10039, the behavior to use when overflowing from int64 is to coerce the result type to double. This ticket should fix all int64 overflow cases in the operators mentioned. |