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

double indexMin defaults to lowest positive double

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Queryable Encryption
    • None
    • Fully Compatible
    • ALL
    • Security 2022-10-31, Security 2022-11-28

      Scope
      Use std::numeric_limits<double>::lowest(), not std::numeric_limits<double>::min(), for the default index minimum value for double.

      std::numeric_limits<double>::min() is used in the following locations:

      Background & Motivation

      SERVER-70066 applied changes to prohibit setting a custom minimum and maximum index value for double. std::numeric_limits<double>::min() returns the minimum positive normalized value.
      The expected behavior is to use std::numeric_limits<double>::lowest(), the lowest negative value.

      The index min/max has no impact on how double is encoded in getTypeInfoDouble. But it is applied to getMinCover when an infinite bound is specified:

      https://github.com/mongodb/mongo/blob/d82601cca796acb046db331fd08ab222da7cb316/src/mongo/crypto/fle_crypto.cpp#L1499-L1504

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: