[SERVER-51455] Fix SBE hashValue for the double type values Created: 09/Oct/20  Updated: 29/Oct/23  Resolved: 14/Oct/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.9.0

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

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2020-10-19
Participants:
Linked BF Score: 81

 Description   

hashValue tries to hash doubles as integers so that e.g. 2.0 (double) and 2 (integer) hash to the same value. This is important in order to keep the assumption v1 == v2 => hash(v1) == hash(v2).

We do it by simply casting doubles to integers and then hashing the integers. Unfortunately, ubsan is unhappy about casting weird values not representable as integers (i.e. NaN, Inf, too big). 

The fix is obvious.



 Comments   
Comment by Githook User [ 14/Oct/20 ]

Author:

{'name': 'Martin Neupauer', 'email': 'xmaton@messengeruser.com'}

Message: SERVER-51455 Fix SBE hashValue for the double type values
Branch: master
https://github.com/mongodb/mongo/commit/750ea05995aae6ed3be987959e7435122287918c

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