diff options
author | Yu Jin Kang Park <yujin.kang@mongodb.com> | 2022-10-21 12:45:16 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-21 13:15:26 +0000 |
commit | 589f542e76184a9a604ed0465f994093112edab6 (patch) | |
tree | d84ac77f4d7b7d41deb4333494bf8615339b4e14 /src/mongo/db/global_index.cpp | |
parent | fab997bf60ede64f7e5ca78b15a9ad2661e88e6a (diff) | |
download | mongo-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.cpp | 9 |
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()); } |