[SERVER-60453] Fix sbe::vm::genericCompare() to be consistent about how it handles NaN Created: 04/Oct/21  Updated: 29/Oct/23  Resolved: 05/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Drew Paroski Assignee: Drew Paroski
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.1
Sprint: QE 2021-10-18
Participants:

 Description   

Before SERVER-58155, sbe::vm::genericCompare() always return false if either argument (or both arguments) was NaN.

After SERVER-58155, if either argument (or both arguments) is NaN, in some cases sbe::vm::genericCompare() can return true. For example, if one argument is {NumberDouble, NaN} and the other argument is {NumberDecimal, NaN}, sbe::vm::genericCompare<std::equal_to<>>() returns true.

The goal of this ticket is to fix this inconsistency.



 Comments   
Comment by Githook User [ 05/Oct/21 ]

Author:

{'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}

Message: SERVER-60453 Fix sbe::vm::genericCompare() to be consistent about how it handles NaN
Branch: v5.1
https://github.com/mongodb/mongo/commit/70668555ccbf35b742b415e0c53f1045badc44fb

Comment by Githook User [ 05/Oct/21 ]

Author:

{'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}

Message: SERVER-60453 Fix sbe::vm::genericCompare() to be consistent about how it handles NaN
Branch: master
https://github.com/mongodb/mongo/commit/547e8e91188f686f6074b83e6a7732a25ea7f9bc

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