summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/sbe_stage_builder_projection.cpp
diff options
context:
space:
mode:
authorEric Cox <eric.cox@mongodb.com>2020-07-07 15:18:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-24 20:19:03 +0000
commitb9515a079627f792c910c8ed2bb683cc9b071ebd (patch)
treeba4f826742cedb7aa5bda6f3dbd41ae09136261e /src/mongo/db/query/sbe_stage_builder_projection.cpp
parentf69521a0ec5a98e91a38077704b3bdca8377ebb6 (diff)
downloadmongo-b9515a079627f792c910c8ed2bb683cc9b071ebd.tar.gz
SERVER-49122 Implement dateFromParts expression for date manipulation in SBE
Diffstat (limited to 'src/mongo/db/query/sbe_stage_builder_projection.cpp')
-rw-r--r--src/mongo/db/query/sbe_stage_builder_projection.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/query/sbe_stage_builder_projection.cpp b/src/mongo/db/query/sbe_stage_builder_projection.cpp
index 39ca0bd89e2..37092972125 100644
--- a/src/mongo/db/query/sbe_stage_builder_projection.cpp
+++ b/src/mongo/db/query/sbe_stage_builder_projection.cpp
@@ -123,6 +123,8 @@ struct ProjectionTraversalVisitorContext {
nullptr)};
}
+ OperationContext* opCtx;
+
projection_ast::ProjectType projectType;
sbe::value::SlotIdGenerator* const slotIdGenerator;
sbe::value::FrameIdGenerator* const frameIdGenerator;
@@ -215,7 +217,8 @@ public:
// 'evals' stack. If the expression is translated into a sub-tree, stack it with the
// existing 'fieldPathExpressionsTraverseStage' sub-tree.
auto [outputSlot, expr, stage] =
- generateExpression(node->expressionRaw(),
+ generateExpression(_context->opCtx,
+ node->expressionRaw(),
std::move(_context->topLevel().fieldPathExpressionsTraverseStage),
_context->slotIdGenerator,
_context->frameIdGenerator,
@@ -365,13 +368,14 @@ private:
} // namespace
std::pair<sbe::value::SlotId, PlanStageType> generateProjection(
+ OperationContext* opCtx,
const projection_ast::Projection* projection,
PlanStageType stage,
sbe::value::SlotIdGenerator* slotIdGenerator,
sbe::value::FrameIdGenerator* frameIdGenerator,
sbe::value::SlotId inputVar) {
ProjectionTraversalVisitorContext context{
- projection->type(), slotIdGenerator, frameIdGenerator, std::move(stage), inputVar};
+ opCtx, projection->type(), slotIdGenerator, frameIdGenerator, std::move(stage), inputVar};
context.relevantSlots.push_back(inputVar);
ProjectionTraversalPreVisitor preVisitor{&context};
ProjectionTraversalPostVisitor postVisitor{&context};