[SERVER-50445] Return the value as double when NumberLong subtraction overflows in ExpressionSubtract Created: 21/Aug/20  Updated: 29/Oct/23  Resolved: 03/Nov/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0, 4.0.22, 3.6.22, 4.4.3, 4.2.12

Type: Bug Priority: Major - P3
Reporter: Arun Banala Assignee: Arun Banala
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-14006 Investigate changes in SERVER-50445: ... Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0, v3.6
Sprint: Query 2020-10-05, Query 2020-10-19, Query 2020-11-02, Query 2020-11-16
Participants:
Linked BF Score: 14

 Description   

The ExpressionSubtract does subtract operation on two long long data type. This can cause an overflow with large numbers. The right way to do this is to use the DoubleDoubleSummation helper that we use while adding number in ExpressionSum.



 Comments   
Comment by Githook User [ 20/Nov/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50445 Return the value in double when NumberLong subtraction overflows in ExpressionSubtract

(cherry picked from commit 3518bd82e49b6941ee7a2f3a868df40114b0d8fc)
(cherry picked from commit 309b631dd16e90e1f3fb8bf3567df1fedc92d715)
Branch: v3.6
https://github.com/mongodb/mongo/commit/0236c6ae996dea4ca8dbc086dc8e61d7d7fac654

Comment by Githook User [ 20/Nov/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50445 Return the value in double when NumberLong subtraction overflows in ExpressionSubtract

(cherry picked from commit 3518bd82e49b6941ee7a2f3a868df40114b0d8fc)
(cherry picked from commit 309b631dd16e90e1f3fb8bf3567df1fedc92d715)
Branch: v4.0
https://github.com/mongodb/mongo/commit/948e065e29ea96d6d248c50f4cfa8fb71cbcec55

Comment by Githook User [ 20/Nov/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50445 Return the value in double when NumberLong subtraction overflows in ExpressionSubtract

(cherry picked from commit 3518bd82e49b6941ee7a2f3a868df40114b0d8fc)
(cherry picked from commit 309b631dd16e90e1f3fb8bf3567df1fedc92d715)
Branch: v4.2
https://github.com/mongodb/mongo/commit/23054195b6bf8ae84d7c06610b062f22632402fd

Comment by Githook User [ 20/Nov/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50445 Allocate expCtx on heap to avoid malloc() issue in unittests
Branch: v4.4
https://github.com/mongodb/mongo/commit/1b97d63858fe86d09cc7ce4d08023d0112a14253

Comment by Githook User [ 19/Nov/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50445 Return the value in double when NumberLong subtraction overflows in ExpressionSubtract

(cherry picked from commit 3518bd82e49b6941ee7a2f3a868df40114b0d8fc)
Branch: v4.4
https://github.com/mongodb/mongo/commit/4375cd741ec7cec374f591e476ee452df23c2d7d

Comment by Githook User [ 03/Nov/20 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-50445 Return the value in double when NumberLong subtraction overflows in ExpressionSubtract
Branch: master
https://github.com/mongodb/mongo/commit/3518bd82e49b6941ee7a2f3a868df40114b0d8fc

Generated at Thu Feb 08 05:22:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.