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

A collator should be passed as an argument to "generateSortKey" builtin in SBE

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v6.0
    • QO 2022-05-16, QO 2022-05-30
    • 61

      Currently when we generate a generateSortKey expression in the SBE stage builder we construct a SortSpec argument, which is an SBE value holding some data required to generate a sort key. One of fields in the SortSpec is an unowned collator pointer, which we take from the CanonicalQuery. However, if this plan gets cached and we try to recover it from the cache, this pointer becomes stale. As a bare minimum we should clone the collator before stashing it into the plan, and perhaps make the key pattern BSON owned too.

      We can also try to explore a possibility of auto-parameterizing query collation.

            Assignee:
            anton.korshunov@mongodb.com Anton Korshunov
            Reporter:
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: