summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Fefer <ivan.fefer@mongodb.com>2022-10-10 15:28:38 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-02 14:28:31 +0000
commit16576b522b4cde4200e01817c154654b90d41d56 (patch)
tree48137fa6789f651839288dc9a6a488ffe27f7083
parente0464c5e9031f851e955ce5ad4583b3c9caa0d74 (diff)
downloadmongo-16576b522b4cde4200e01817c154654b90d41d56.tar.gz
SERVER-70394 Fix self-swap in MultiPlanStage::removeRejectedPlans
(cherry picked from commit df498b17710f364a853c4dc1731cbdc6ec91e0f5)
-rw-r--r--src/mongo/db/exec/multi_plan.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp
index 0045dcfc379..a702f1c5f84 100644
--- a/src/mongo/db/exec/multi_plan.cpp
+++ b/src/mongo/db/exec/multi_plan.cpp
@@ -373,7 +373,7 @@ void MultiPlanStage::removeRejectedPlans() {
}
size_t startIndex = 1;
if (_backupPlanIdx != kNoSuchPlan) {
- if (_bestPlanIdx != 1) {
+ if (_backupPlanIdx != 1) {
std::swap(_children[_backupPlanIdx], _children[1]);
std::swap(_candidates[_backupPlanIdx], _candidates[1]);
_backupPlanIdx = 1;