[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: |
|
||||
| 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: |