[SERVER-80422] Absl may pick wrong template function for hashing CollatorInterface* Created: 25/Aug/23  Updated: 29/Oct/23  Resolved: 28/Aug/23

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

Type: Task Priority: Major - P3
Reporter: Alya Berciu Assignee: Alya Berciu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 53

 Description   

There are two possible templated functions which absl could use to hash a CollatorInterface*; unfortunately, instead of picking the custom one in expression_hasher.cpp, it picks the default hash function which uses the value of the pointer. This results in two equivalent expressions with collators defined hashing to different values, causing a build failure (BF-29584) in unit tests exercising this behavior.

The simple fix is to just avoid the ambiguous choice of template functions by directly checking if the collator interface is non-null, and passing a reference to the collation instance directly to the hash function.



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

Author:

{'name': 'Alya Berciu', 'email': 'alya.berciu@mongodb.com', 'username': 'alyacb'}

Message: SERVER-80422 Pass collator directly to comparison match expression hash
Branch: master
https://github.com/mongodb/mongo/commit/6361fb556fb25ba07e02c5f0875d183a1561b59e

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