diff options
author | Jason Rassi <rassi@10gen.com> | 2014-09-22 17:47:57 -0400 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2014-09-22 18:09:36 -0400 |
commit | a093502b6c97731a964aff8b499ec0378c3c53e5 (patch) | |
tree | 8106ec9833cc72d706db4898427823598257903f /src | |
parent | 34ec0d9eb7dcfbab15aa60823e5c869cc6177cba (diff) | |
download | mongo-a093502b6c97731a964aff8b499ec0378c3c53e5.tar.gz |
SERVER-15287 LiteParsedQuery should take ownership of request params
(cherry picked from commit 2ca7cef6b39d1ffc0c8b54ca6e12bb9d8c633060)
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/query/lite_parsed_query.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/query/lite_parsed_query.cpp b/src/mongo/db/query/lite_parsed_query.cpp index 8b439ee3054..c81efba9dcb 100644 --- a/src/mongo/db/query/lite_parsed_query.cpp +++ b/src/mongo/db/query/lite_parsed_query.cpp @@ -51,10 +51,10 @@ namespace mongo { bool explain, LiteParsedQuery** out) { auto_ptr<LiteParsedQuery> pq(new LiteParsedQuery()); - pq->_sort = sort; - pq->_hint = hint; - pq->_min = minObj; - pq->_max = maxObj; + pq->_sort = sort.getOwned(); + pq->_hint = hint.getOwned(); + pq->_min = minObj.getOwned(); + pq->_max = maxObj.getOwned(); pq->_snapshot = snapshot; pq->_explain = explain; @@ -289,7 +289,7 @@ namespace mongo { if (0 == strcmp("$orderby", name) || 0 == strcmp("orderby", name)) { if (Object == e.type()) { - _sort = e.embeddedObject(); + _sort = e.embeddedObject().getOwned(); } else if (Array == e.type()) { _sort = e.embeddedObject(); @@ -340,17 +340,17 @@ namespace mongo { if (!e.isABSONObj()) { return Status(ErrorCodes::BadValue, "$min must be a BSONObj"); } - _min = e.embeddedObject(); + _min = e.embeddedObject().getOwned(); } else if (str::equals("max", name)) { if (!e.isABSONObj()) { return Status(ErrorCodes::BadValue, "$max must be a BSONObj"); } - _max = e.embeddedObject(); + _max = e.embeddedObject().getOwned(); } else if (str::equals("hint", name)) { if (e.isABSONObj()) { - _hint = e.embeddedObject(); + _hint = e.embeddedObject().getOwned(); } else { // Hint can be specified as an object or as a string. Wrap takes care of |