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

[SBE] Add support for ExpressionMeta when _metaType == MetaType::kIndexKey

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Query Execution
    • ALL
    • Hide
      > db.adminCommand({setParameter: 1, internalQueryEnableSlotBasedExecutionEngine: true});
      > db.c1.createIndex({a:1});
      > db.c1.find({a: 1}, {c: {$meta: 'indexKey'}});
      

       

      Show
      > db.adminCommand({setParameter: 1, internalQueryEnableSlotBasedExecutionEngine: true}); > db.c1.createIndex({a:1}); > db.c1.find({a: 1}, {c: {$meta: 'indexKey'}});  

      A simple query with an index and $meta fails.

      Right now the query from the "Steps To Reproduce" section hits an invariant failure: reqs.has(kReturnKey) || !ixn->addKeyMetadata .

      I tried fixing this invariant by calling PlanStageReqs::set() at the top level to set kReturnKey, and then I re-ran the query from the "Steps To Reproduce" section. When I did this, I got the following error message: "Expression is not supported in SBE: $meta".

      So it looks like we need to update "sbe_stage_builder_expression.cpp" so that it can handle ExpressionMeta with _metaType == MetaType::kIndexKey .

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            martin.neupauer@mongodb.com Martin Neupauer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: