diff options
author | Qingyang Chen <qingyang.chen@10gen.com> | 2015-06-22 13:22:45 -0400 |
---|---|---|
committer | Qingyang Chen <qingyang.chen@10gen.com> | 2015-06-22 13:22:45 -0400 |
commit | 22cf042f9541cf778f71e1bd1a84fcd87012c0b1 (patch) | |
tree | 0d293b08d819409580f7087654b5d6f81d5d40a4 /src/mongo/db/dbhelpers.cpp | |
parent | 3f6f66daac840fe2b2dc26eeeacbf015479567df (diff) | |
download | mongo-22cf042f9541cf778f71e1bd1a84fcd87012c0b1.tar.gz |
Revert "SERVER-16889 query subsystem CanonicalQuery::canonicalize use StatusWith<unique_ptr> for ownership transfer"
This reverts commit 3f6f66daac840fe2b2dc26eeeacbf015479567df.
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 0517552c7c2..e5e198d7ff0 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -129,19 +129,18 @@ RecordId Helpers::findOne(OperationContext* txn, if (!collection) return RecordId(); + CanonicalQuery* cq; const WhereCallbackReal whereCallback(txn, collection->ns().db()); - auto statusWithCQ = CanonicalQuery::canonicalize(collection->ns(), query, whereCallback); - massert(17244, "Could not canonicalize " + query.toString(), statusWithCQ.isOK()); - unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue()); + massert(17244, + "Could not canonicalize " + query.toString(), + CanonicalQuery::canonicalize(collection->ns(), query, &cq, whereCallback).isOK()); PlanExecutor* rawExec; size_t options = requireIndex ? QueryPlannerParams::NO_TABLE_SCAN : QueryPlannerParams::DEFAULT; - massert( - 17245, - "Could not get executor for query " + query.toString(), - getExecutor(txn, collection, cq.release(), PlanExecutor::YIELD_MANUAL, &rawExec, options) - .isOK()); + massert(17245, + "Could not get executor for query " + query.toString(), + getExecutor(txn, collection, cq, PlanExecutor::YIELD_MANUAL, &rawExec, options).isOK()); unique_ptr<PlanExecutor> exec(rawExec); PlanExecutor::ExecState state; |