[SERVER-60528] Fix how SBE performs comparisons between 64-bit integers and doubles Created: 07/Oct/21  Updated: 29/Oct/23  Resolved: 13/Oct/21

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

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
Steps To Reproduce:

 

> db.c.drop()
> db.c.insert({_id: 1, a: 9007199254740992})

> db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: false})
> db.c.find({a: NumberLong("9007199254740993")}).itcount()
1
 
> db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true})
> db.c.find({a: NumberLong("9007199254740993")}).itcount()
0

 

Sprint: QE 2021-10-18
Participants:

 Description   

There are some cases where SBE produces results that don't agree with the classic engine when performing comparisons between 64-bit integers and doubles.

Here is an example of a query that produces different results under SBE vs. the classic engine:

> db.c.insert({a: 9007199254740992})
> db.c.find({a: NumberLong("9007199254740993")})

Under SBE, (assuming there is no index on field "a") the query above will return 1 document. Under the classic engine the query above will return 0 documents.

The goal of this task is to fix this inconsistency so that SBE and classic engine produce the same results when performing comparisons between 64-bit integers and doubles. 



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

Author:

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

Message: SERVER-60528 Fix how SBE performs comparisons between 64-bit integers and doubles

(cherry picked from commit 1b994ff8d7ea7b6761aa516fa66b518e4b034095)
Branch: v5.1
https://github.com/mongodb/mongo/commit/71ecbc12011dab7ecef04e88bfa490820816d305

Comment by Githook User [ 13/Oct/21 ]

Author:

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

Message: SERVER-60528 Fix how SBE performs comparisons between 64-bit integers and doubles
Branch: master
https://github.com/mongodb/mongo/commit/1b994ff8d7ea7b6761aa516fa66b518e4b034095

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