summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbcommands.cpp
diff options
context:
space:
mode:
authorQingyang Chen <qingyang.chen@10gen.com>2015-06-16 16:16:12 -0400
committerQingyang Chen <qingyang.chen@10gen.com>2015-06-22 13:17:31 -0400
commit3f6f66daac840fe2b2dc26eeeacbf015479567df (patch)
tree3b8f907c22f9ec41f1a72d1ea71f1dff8376a77d /src/mongo/db/dbcommands.cpp
parent1e786585ae83e55e13016a6761a121b502c887f8 (diff)
downloadmongo-3f6f66daac840fe2b2dc26eeeacbf015479567df.tar.gz
SERVER-16889 query subsystem CanonicalQuery::canonicalize use StatusWith<unique_ptr> for ownership transfer
Diffstat (limited to 'src/mongo/db/dbcommands.cpp')
-rw-r--r--src/mongo/db/dbcommands.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index 935b4ec41f6..ba7e84b6e31 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -587,11 +587,12 @@ public:
BSONObj sort = BSON("files_id" << 1 << "n" << 1);
MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN {
- CanonicalQuery* cq;
- if (!CanonicalQuery::canonicalize(ns, query, sort, BSONObj(), &cq).isOK()) {
+ auto statusWithCQ = CanonicalQuery::canonicalize(ns, query, sort, BSONObj());
+ if (!statusWithCQ.isOK()) {
uasserted(17240, "Can't canonicalize query " + query.toString());
return 0;
}
+ unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue());
// Check shard version at startup.
// This will throw before we've done any work if shard version is outdated
@@ -602,7 +603,7 @@ public:
PlanExecutor* rawExec;
if (!getExecutor(txn,
coll,
- cq,
+ cq.release(),
PlanExecutor::YIELD_MANUAL,
&rawExec,
QueryPlannerParams::NO_TABLE_SCAN).isOK()) {