summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-05-07 17:10:59 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-05-09 15:53:49 -0400
commitdddf68d86a8c12b0e37d8b3ccfdb58623aaba4e3 (patch)
treeb0e0847de6499d318885b122371341698c03d243 /src/mongo/db/dbhelpers.cpp
parent19cceceb780ab13104d5a4e44c373472ac5f430d (diff)
downloadmongo-dddf68d86a8c12b0e37d8b3ccfdb58623aaba4e3.tar.gz
SERVER-13797 Abstract $where processing and remove usages of getContext
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r--src/mongo/db/dbhelpers.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index 0e218ca7be9..6f47e7bff7e 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -100,8 +100,10 @@ namespace mongo {
return DiskLoc();
CanonicalQuery* cq;
+ const WhereCallbackReal whereCallback(collection->ns().db());
+
massert(17244, "Could not canonicalize " + query.toString(),
- CanonicalQuery::canonicalize(collection->ns(), query, &cq).isOK());
+ CanonicalQuery::canonicalize(collection->ns(), query, &cq, whereCallback).isOK());
Runner* rawRunner;
size_t options = requireIndex ? QueryPlannerParams::NO_TABLE_SCAN : QueryPlannerParams::DEFAULT;
@@ -166,8 +168,11 @@ namespace mongo {
Client::Context ctx(ns);
CanonicalQuery* cq;
+ const NamespaceString nss(ns);
+ const WhereCallbackReal whereCallback(nss.db());
+
uassert(17236, "Could not canonicalize " + query.toString(),
- CanonicalQuery::canonicalize(ns, query, &cq).isOK());
+ CanonicalQuery::canonicalize(ns, query, &cq, whereCallback).isOK());
Runner* rawRunner;
uassert(17237, "Could not get runner for query " + query.toString(),