diff options
author | Jason Rassi <rassi@10gen.com> | 2014-01-14 18:53:42 -0500 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2014-01-21 02:11:48 -0500 |
commit | 400f00648f2ade62031d6dc2efe0cf7f51de9010 (patch) | |
tree | fd8db138fae8e492be56f048c20fad0b18d21b12 /src/mongo/db/pipeline/pipeline_d.cpp | |
parent | 320397d71a0344db775146e42a54d755241533b2 (diff) | |
download | mongo-400f00648f2ade62031d6dc2efe0cf7f51de9010.tar.gz |
SERVER-12038 PipelineD::prepareCursorSource resilient to CQ failure
Query clients should check return value of canonicalize (since e.g.
queries with $meta sort but no $meta projection should fail to
canonicalize).
Diffstat (limited to 'src/mongo/db/pipeline/pipeline_d.cpp')
-rw-r--r-- | src/mongo/db/pipeline/pipeline_d.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index ec192698007..0578f2ac5aa 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -203,14 +203,14 @@ namespace { CanonicalQuery* cq; // Passing an empty projection since it is faster to use documentFromBsonWithDeps. // This will need to change to support covering indexes (SERVER-12015). - uassertStatusOK( + Status status = CanonicalQuery::canonicalize(pExpCtx->ns, queryObj, sortObj, needQueryProjection ? projection : BSONObj(), - &cq)); + &cq); Runner* rawRunner; - if (getRunner(cq, &rawRunner, runnerOptions).isOK()) { + if (status.isOK() && getRunner(cq, &rawRunner, runnerOptions).isOK()) { // success: The Runner will handle sorting for us using an index. runner.reset(rawRunner); sortInRunner = true; |