summaryrefslogtreecommitdiff
path: root/src/mongo/db/global_index.cpp
diff options
context:
space:
mode:
authorYu Jin Kang Park <yujin.kang@mongodb.com>2022-10-21 12:45:16 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-10-21 13:15:26 +0000
commit589f542e76184a9a604ed0465f994093112edab6 (patch)
treed84ac77f4d7b7d41deb4333494bf8615339b4e14 /src/mongo/db/global_index.cpp
parentfab997bf60ede64f7e5ca78b15a9ad2661e88e6a (diff)
downloadmongo-589f542e76184a9a604ed0465f994093112edab6.tar.gz
SERVER-70328 Fix unused return code in global_index::deleteKey
Diffstat (limited to 'src/mongo/db/global_index.cpp')
-rw-r--r--src/mongo/db/global_index.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/global_index.cpp b/src/mongo/db/global_index.cpp
index 254a80506a1..3addce499c6 100644
--- a/src/mongo/db/global_index.cpp
+++ b/src/mongo/db/global_index.cpp
@@ -280,15 +280,16 @@ void deleteKey(OperationContext* opCtx,
// For now _id is unique, so we assume only one entry can be returned.
BSONObj deletedObj;
- planExecutor->getNext(&deletedObj, nullptr);
+ auto execState = planExecutor->getNext(&deletedObj, nullptr);
- // Return error if no document has been found (deletedObj is empty) or if the associated
- // "key" does not match the key provided as parameter.
+ // Return error if no document has been found or if the associated "key" does not match the key
+ // provided as parameter.
uassert(ErrorCodes::KeyNotFound,
str::stream() << "Global index container with UUID " << container->uuid()
<< " does not contain specified entry. key:" << key
<< ", docKey:" << docKey,
- deletedObj.woCompare(buildIndexEntry(key, docKey)) == 0);
+ execState == PlanExecutor::ExecState::ADVANCED &&
+ deletedObj.woCompare(buildIndexEntry(key, docKey)) == 0);
fassert(6924202, planExecutor->isEOF());
}