summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/sbe_stage_builder_test_fixture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/sbe_stage_builder_test_fixture.cpp')
-rw-r--r--src/mongo/db/query/sbe_stage_builder_test_fixture.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/query/sbe_stage_builder_test_fixture.cpp b/src/mongo/db/query/sbe_stage_builder_test_fixture.cpp
index c6b0525dea9..91042b7b096 100644
--- a/src/mongo/db/query/sbe_stage_builder_test_fixture.cpp
+++ b/src/mongo/db/query/sbe_stage_builder_test_fixture.cpp
@@ -60,6 +60,10 @@ SbeStageBuilderTestFixture::buildPlanStage(
auto statusWithCQ =
CanonicalQuery::canonicalize(operationContext(), std::move(findCommand), false, expCtx);
ASSERT_OK(statusWithCQ.getStatus());
+ if (hasRecordId) {
+ // Force the builder to generate the RecordId output even if it isn't needed by the plan.
+ statusWithCQ.getValue()->setForceGenerateRecordId(true);
+ }
CollectionMock coll(_nss);
CollectionPtr collPtr(&coll);