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

Ensure StringData::compare uses handle return values outside {-1, 0, 1}

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Service Arch 2023-11-27, Service Arch 2023-12-11
    • 153

      SERVER-82604 recently changed the underlying implementation of StringData to rely on std::string_view, and simply pass through most functionality. However, the string_view::compare API contract is different than StringData, so we would still need to clamp the return values to -1, 0, 1 to provide the same compatibility.

      Instead, we would like to audit the codebase for uses of StringData::compare to ensure that callers are not relying on -1/1 values specifically, but instead checking for negative/positive values.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            dan.larkin-york@mongodb.com Dan Larkin-York
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: