[SERVER-75287] Make subtract behavior consistent with addition with regard to checking for overflow Created: 24/Mar/23  Updated: 29/Oct/23  Resolved: 17/May/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc3, 6.0.10

Type: Task Priority: Major - P3
Reporter: Kyle Suarez Assignee: Rushan Chen
Resolution: Fixed Votes: 0
Labels: 7.1-Type-Precision-Fixes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
causes SERVER-77615 Date subtract operation doesn't work ... Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0, v6.0
Participants:
Linked BF Score: 5

 Description   

In the classic engine, the behavior of subtraction for the Date type should be in line with addition, in that it should round double operands and check for overflow to report an error.



 Comments   
Comment by Githook User [ 16/Aug/23 ]

Author:

{'name': 'Rushan Chen', 'email': 'rushan.chen@mongodb.com', 'username': 'ruchen'}

Message: SERVER-75287 Make subtract behavior consistent with addition on overflow treatment
Branch: v6.0
https://github.com/mongodb/mongo/commit/79ea6b07b6fe68ded75fc3ae76e138ffb7ccf1da

Comment by Githook User [ 25/May/23 ]

Author:

{'name': 'Rushan Chen', 'email': 'rushan.chen@mongodb.com', 'username': 'ruchen'}

Message: SERVER-75287: Make subtract behavior consistent with addition with regard to checking for overflow
Branch: v7.0
https://github.com/mongodb/mongo/commit/25185fda9edd408639836cf438fb821bd42c95f5

Comment by Liubov Molchanova [ 24/May/23 ]

Requesting a backport for v7.0 as the issue reproduced in BFG-1957250

Comment by Githook User [ 17/May/23 ]

Author:

{'name': 'Rushan Chen', 'email': 'rushan.chen@mongodb.com', 'username': 'ruchen'}

Message: SERVER-75287: fix rounding and overflow detection in Classic for subtract when one operand is Date and another numeric
Branch: master
https://github.com/mongodb/mongo/commit/1b4a551a6b8c85611e26857217ce1a1e1363e716

Generated at Thu Feb 08 06:29:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.