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

Always sort fieldpath string sets using custom comparator

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0, 6.0.5
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v6.0
    • QO 2022-06-27, QO 2022-07-11

      Whenever we store sets of field paths strings (eg., ["a.b", "a", "c.d"]) use a custom string comparator that treats "." as the first character.

      This is to protect us against future bugs like SERVER-66418.  It also makes the solution to that issue more efficient (because it avoids a set copy) and would allow O(n log n) solutions to many field path comparison functions that currently are O(n^2).  For example `isIndependentOf` and `isOnlyDependentOn` in https://github.com/mongodb/mongo/blob/master/src/mongo/db/matcher/expression_algo.cpp#L802

            Assignee:
            steve.tarzia@mongodb.com Steve Tarzia
            Reporter:
            steve.tarzia@mongodb.com Steve Tarzia
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: