Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80422

Absl may pick wrong template function for hashing CollatorInterface*

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • 53

      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.

            Assignee:
            alya.berciu@mongodb.com Alya Berciu
            Reporter:
            alya.berciu@mongodb.com Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: