From d3e569ea57fab877c9e2b9036c13100828c1e4b3 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Mon, 10 Oct 2022 15:28:38 +0000 Subject: SERVER-70394 Fix self-swap in MultiPlanStage::removeRejectedPlans (cherry picked from commit df498b17710f364a853c4dc1731cbdc6ec91e0f5) --- src/mongo/db/exec/multi_plan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp index 8c816ebdcbd..00254cef133 100644 --- a/src/mongo/db/exec/multi_plan.cpp +++ b/src/mongo/db/exec/multi_plan.cpp @@ -376,7 +376,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; -- cgit v1.2.1