diff options
author | David Storch <david.storch@10gen.com> | 2018-06-12 11:06:07 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2018-06-12 11:06:07 -0400 |
commit | 3215980c2500010c47da2dad0410c291e7854fa8 (patch) | |
tree | 81200f15a76debfba0a9deb23017481e5c2d8a8c /src/mongo/db/query/query_planner.cpp | |
parent | 5c02fd1ae02a5243338cc36bf44cf4c8574edc4e (diff) | |
download | mongo-3215980c2500010c47da2dad0410c291e7854fa8.tar.gz |
Revert "SERVER-35455 Eliminate owned raw pointers from QueryPlannerAccess."
This reverts commit dd1a525f1d1b9e3cf8f902d6c04a17607d565dea.
Diffstat (limited to 'src/mongo/db/query/query_planner.cpp')
-rw-r--r-- | src/mongo/db/query/query_planner.cpp | 14 |
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; |