diff options
-rw-r--r-- | src/mongo/db/query/sbe_stage_builder_index_scan.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/query/sbe_stage_builder_index_scan.cpp b/src/mongo/db/query/sbe_stage_builder_index_scan.cpp index 66072cda4b9..49e9d382fbc 100644 --- a/src/mongo/db/query/sbe_stage_builder_index_scan.cpp +++ b/src/mongo/db/query/sbe_stage_builder_index_scan.cpp @@ -987,8 +987,9 @@ generateSingleIntervalIndexScan(StageBuilderState& state, sbe::makeSV(), nullptr, planNodeId), - boost::make_optional(shouldRegisterLowHighKeyInRuntimeEnv, - std::pair(*lowKeySlot, *highKeySlot))}; + shouldRegisterLowHighKeyInRuntimeEnv + ? boost::make_optional(std::pair(*lowKeySlot, *highKeySlot)) + : boost::none}; } std::pair<std::unique_ptr<sbe::PlanStage>, PlanStageSlots> generateIndexScan( |