summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_planner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/query_planner.cpp')
-rw-r--r--src/mongo/db/query/query_planner.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp
index 5d65081b66e..7e77db9b567 100644
--- a/src/mongo/db/query/query_planner.cpp
+++ b/src/mongo/db/query/query_planner.cpp
@@ -502,7 +502,7 @@ StatusWith<std::unique_ptr<QuerySolution>> QueryPlanner::planFromCache(
// Use the cached index assignments to build solnRoot.
std::unique_ptr<QuerySolutionNode> solnRoot(QueryPlannerAccess::buildIndexedDataAccess(
- query, std::move(clone), params.indices, params));
+ query, clone.release(), false, params.indices, params));
if (!solnRoot) {
return Status(ErrorCodes::BadValue,
@@ -824,15 +824,15 @@ StatusWith<std::vector<std::unique_ptr<QuerySolution>>> QueryPlanner::plan(
PlanEnumerator isp(enumParams);
isp.init().transitional_ignore();
- unique_ptr<MatchExpression> nextTaggedTree;
- while ((nextTaggedTree = isp.getNext()) && (out.size() < params.maxIndexedSolutions)) {
+ unique_ptr<MatchExpression> rawTree;
+ while ((rawTree = isp.getNext()) && (out.size() < params.maxIndexedSolutions)) {
LOG(5) << "About to build solntree from tagged tree:" << endl
- << redact(nextTaggedTree->toString());
+ << redact(rawTree.get()->toString());
// Store the plan cache index tree before calling prepareForAccessingPlanning(), so that
// the PlanCacheIndexTree has the same sort as the MatchExpression used to generate the
// plan cache key.
- std::unique_ptr<MatchExpression> clone(nextTaggedTree->shallowClone());
+ std::unique_ptr<MatchExpression> clone(rawTree.get()->shallowClone());
std::unique_ptr<PlanCacheIndexTree> cacheData;
auto statusWithCacheData = cacheDataFromTaggedTree(clone.get(), relevantIndices);
if (!statusWithCacheData.isOK()) {
@@ -844,11 +844,11 @@ StatusWith<std::vector<std::unique_ptr<QuerySolution>>> QueryPlanner::plan(
// We have already cached the tree in canonical order, so now we can order the nodes for
// access planning.
- prepareForAccessPlanning(nextTaggedTree.get());
+ prepareForAccessPlanning(rawTree.get());
// This can fail if enumeration makes a mistake.
std::unique_ptr<QuerySolutionNode> solnRoot(QueryPlannerAccess::buildIndexedDataAccess(
- query, std::move(nextTaggedTree), relevantIndices, params));
+ query, rawTree.release(), false, relevantIndices, params));
if (!solnRoot) {
continue;