Change arrayQueuePush to accept TagValueOwned instead of raw (tag, val)

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In src/mongo/db/exec/sbe/vm/vm_builtin_agg.cpp, arrayQueuePush has signature:\n\n``cpp\nvoid arrayQueuePush(value::Array* arrayQueue, value::TypeTags tag, value::Value val)\n`\n\nIt immediately wraps the raw }}(tag, val){{ in a }}TagValueOwned{{ on entry:\n\n`cpp\nvalue::TagValueOwned tagVal(tag, val);\n`{{\n\nThis is an odd ownership convention — the function takes ownership of a raw pair but doesn't express that in its type. The signature should be changed to accept }}TagValueOwned{{ directly, which makes the ownership transfer explicit and consistent with the RAII approach being promoted across the SBE codebase.\n\nAll four call sites feed it from }}field.releaseToRaw(){{ (after SERVER-120843), so they should be updated to pass a }}TagValueOwned` directly.\n\nPart of the SPM-4577 RAII refactor epic.

            Assignee:
            Evan Bergeron
            Reporter:
            Evan Bergeron
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: