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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Dan Larkin-York
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: