diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-05-07 17:10:59 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-05-09 15:53:49 -0400 |
commit | dddf68d86a8c12b0e37d8b3ccfdb58623aaba4e3 (patch) | |
tree | b0e0847de6499d318885b122371341698c03d243 /src/mongo/db/commands/index_filter_commands.cpp | |
parent | 19cceceb780ab13104d5a4e44c373472ac5f430d (diff) | |
download | mongo-dddf68d86a8c12b0e37d8b3ccfdb58623aaba4e3.tar.gz |
SERVER-13797 Abstract $where processing and remove usages of getContext
Diffstat (limited to 'src/mongo/db/commands/index_filter_commands.cpp')
-rw-r--r-- | src/mongo/db/commands/index_filter_commands.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/commands/index_filter_commands.cpp b/src/mongo/db/commands/index_filter_commands.cpp index 0e35bc296ab..9f006ad7ac7 100644 --- a/src/mongo/db/commands/index_filter_commands.cpp +++ b/src/mongo/db/commands/index_filter_commands.cpp @@ -29,6 +29,7 @@ #include <string> #include <sstream> +#include "mongo/db/matcher/expression_parser.h" #include "mongo/base/init.h" #include "mongo/base/owned_pointer_vector.h" #include "mongo/base/status.h" @@ -40,6 +41,7 @@ #include "mongo/db/commands/plan_cache_commands.h" #include "mongo/db/catalog/collection.h" + namespace { using std::string; @@ -269,6 +271,9 @@ namespace mongo { // OK to proceed with clearing entire cache. querySettings->clearAllowedIndices(); + const NamespaceString nss(ns); + const WhereCallbackReal whereCallback(nss.db()); + // Remove corresponding entries from plan cache. // Admin hints affect the planning process directly. If there were // plans generated as a result of applying index filter, these need to be @@ -286,8 +291,8 @@ namespace mongo { // Create canonical query. CanonicalQuery* cqRaw; - Status result = CanonicalQuery::canonicalize(ns, entry->query, entry->sort, - entry->projection, &cqRaw); + Status result = CanonicalQuery::canonicalize( + ns, entry->query, entry->sort, entry->projection, &cqRaw, whereCallback); invariant(result.isOK()); scoped_ptr<CanonicalQuery> cq(cqRaw); |