[SERVER-58155] Equality semantics changed for double/decimal in SBE Created: 29/Jun/21  Updated: 29/Oct/23  Resolved: 10/Sep/21

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

Type: Bug Priority: Major - P3
Reporter: Brian DeLeonardis (Inactive) Assignee: Martin Neupauer
Resolution: Fixed Votes: 0
Labels: sbe-diff
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-59584 Fix equality comparison in classic en... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Create a collection: lookup_numeric_mixed:

{ "_id" : ObjectId("60db590cbb5709ba513cb8c9"), "a" : 5.01 } { "_id" : ObjectId("60db5914bb5709ba513cb8ca"), "a" : NumberDecimal("5.01") } { "_id" : ObjectId("60db591cbb5709ba513cb8cb"), "a" : NumberDecimal("5.0100") }

Run the following pipeline on it:
[
{
"$lookup":

{ "from": "lookup_numeric_mixed", "localField": "a", "foreignField": "a", "as": "docs" }

},
{
"$project":

{ "_id": 0, "docs._id": 0 }

}
]
Observe that the results on 4.4 and 5.0rc2 are different.

Sprint: Query Execution 2021-07-26, QE 2021-08-09, QE 2021-08-23, QE 2021-09-06, QE 2021-09-20
Participants:

 Description   

In 4.4 the values: 5.01 (a double) and NumberDecimal("5.01") are not equal to each other according to $lookup with localField/foreignField. However when I tested this on 5.0rc2 they were counted as equal. This behavior did not occur on rc5. ksuarz@gmail.com suggested that this is likely due to the new SBE engine.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 10/Sep/21 ]

Author:

{'name': 'Martin Neupauer', 'email': 'martin.neupauer@mongodb.com', 'username': 'MartinNeupauer'}

Message: SERVER-58155 Emulate classic engine double/decimal equality comparisons
Branch: master
https://github.com/mongodb/mongo/commit/48aff5ab982993a413baedd21901c6c74aacdcc5

Comment by Ana Meza [ 15/Jul/21 ]

Passing this one to you to confirm if this should be on the SBE Rollout project

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