summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec
diff options
context:
space:
mode:
authorDavid Percy <david.percy@mongodb.com>2019-11-11 18:50:37 +0000
committerevergreen <evergreen@mongodb.com>2019-11-11 18:50:37 +0000
commit2411853a626e2c28e8bc54c82490cbb2ab9947a0 (patch)
tree1fde60264e4ccfecaded6cbfa8aa15cd26e3951e /src/mongo/db/exec
parent2b64ed2d9049a10cf105f3fb1258062678bfd682 (diff)
downloadmongo-2411853a626e2c28e8bc54c82490cbb2ab9947a0.tar.gz
SERVER-14643 Return informative Status from QueryPlanner::plan
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r--src/mongo/db/exec/cached_plan.cpp9
-rw-r--r--src/mongo/db/exec/subplan.cpp16
2 files changed, 0 insertions, 25 deletions
diff --git a/src/mongo/db/exec/cached_plan.cpp b/src/mongo/db/exec/cached_plan.cpp
index acfaafd2983..9738936f4b7 100644
--- a/src/mongo/db/exec/cached_plan.cpp
+++ b/src/mongo/db/exec/cached_plan.cpp
@@ -203,17 +203,8 @@ Status CachedPlanStage::replan(PlanYieldPolicy* yieldPolicy, bool shouldCache) {
str::stream() << "error processing query: " << _canonicalQuery->toString()
<< " planner returned error");
}
-
auto solutions = std::move(statusWithSolutions.getValue());
- // We cannot figure out how to answer the query. Perhaps it requires an index
- // we do not have?
- if (0 == solutions.size()) {
- return Status(ErrorCodes::NoQueryExecutionPlans,
- str::stream() << "error processing query: " << _canonicalQuery->toString()
- << " No query solutions");
- }
-
if (1 == solutions.size()) {
// Only one possible plan. Build the stages from the solution.
auto newRoot =
diff --git a/src/mongo/db/exec/subplan.cpp b/src/mongo/db/exec/subplan.cpp
index 5c815d87c30..c6fc9991185 100644
--- a/src/mongo/db/exec/subplan.cpp
+++ b/src/mongo/db/exec/subplan.cpp
@@ -165,13 +165,6 @@ Status SubplanStage::planSubqueries() {
branchResult->solutions = std::move(solutions.getValue());
LOG(5) << "Subplanner: got " << branchResult->solutions.size() << " solutions";
-
- if (0 == branchResult->solutions.size()) {
- // If one child doesn't have an indexed solution, bail out.
- str::stream ss;
- ss << "No solutions for subchild " << branchResult->canonicalQuery->toString();
- return Status(ErrorCodes::BadValue, ss);
- }
}
}
@@ -371,17 +364,8 @@ Status SubplanStage::choosePlanWholeQuery(PlanYieldPolicy* yieldPolicy) {
str::stream() << "error processing query: " << _query->toString()
<< " planner returned error");
}
-
auto solutions = std::move(statusWithSolutions.getValue());
- // We cannot figure out how to answer the query. Perhaps it requires an index
- // we do not have?
- if (0 == solutions.size()) {
- return Status(ErrorCodes::NoQueryExecutionPlans,
- str::stream() << "error processing query: " << _query->toString()
- << " No query solutions");
- }
-
if (1 == solutions.size()) {
// Only one possible plan. Run it. Build the stages from the solution.
auto root = StageBuilder::build(getOpCtx(), collection(), *_query, *solutions[0], _ws);