diff options
author | Mihai Andrei <mihai.andrei@10gen.com> | 2020-07-21 15:49:39 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-24 20:31:10 +0000 |
commit | 2e02a4afe323396e15073a38244889862353836c (patch) | |
tree | d1b2012be26759e17cae5d15a934e0a78d4bf66d /src/mongo/db/query | |
parent | b9515a079627f792c910c8ed2bb683cc9b071ebd (diff) | |
download | mongo-2e02a4afe323396e15073a38244889862353836c.tar.gz |
SERVER-49784 PlanExecutorImpl::getNext should only modify 'objOut' if getNextDocument returns ADVANCED
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r-- | src/mongo/db/query/plan_executor_impl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/query/plan_executor_impl.cpp b/src/mongo/db/query/plan_executor_impl.cpp index cc3923a7990..8b0126ed50b 100644 --- a/src/mongo/db/query/plan_executor_impl.cpp +++ b/src/mongo/db/query/plan_executor_impl.cpp @@ -305,7 +305,7 @@ void PlanExecutorImpl::reattachToOperationContext(OperationContext* opCtx) { PlanExecutor::ExecState PlanExecutorImpl::getNext(BSONObj* objOut, RecordId* dlOut) { const auto state = getNextDocument(&_docOutput, dlOut); - if (objOut) { + if (objOut && state == ExecState::ADVANCED) { const bool includeMetadata = _expCtx && _expCtx->needsMerge; *objOut = includeMetadata ? _docOutput.toBsonWithMetaData() : _docOutput.toBson(); } |