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

Fix SBE hashValue for the double type values

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Query 2020-10-19
    • 81

      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.

            Assignee:
            martin.neupauer@mongodb.com Martin Neupauer
            Reporter:
            martin.neupauer@mongodb.com Martin Neupauer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: