diff options
author | David Storch <david.storch@10gen.com> | 2015-12-14 18:22:01 -0500 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2015-12-22 10:13:40 -0500 |
commit | 26bcf4ddd7e86885448e981f86aaf51fba0e2539 (patch) | |
tree | 5d9cd1de1193f8c52f8d1eae3dd3e35a3bffd3f0 /src/mongo/dbtests/query_stage_cached_plan.cpp | |
parent | 3663e004dfc2f73b82b3d88b5fa1ac6b7dcd1d33 (diff) | |
download | mongo-26bcf4ddd7e86885448e981f86aaf51fba0e2539.tar.gz |
SERVER-21407 explicitly disallow $text/$where extensions during MatchExpression parsing
Diffstat (limited to 'src/mongo/dbtests/query_stage_cached_plan.cpp')
-rw-r--r-- | src/mongo/dbtests/query_stage_cached_plan.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/dbtests/query_stage_cached_plan.cpp b/src/mongo/dbtests/query_stage_cached_plan.cpp index aff0f037bb4..132859afb92 100644 --- a/src/mongo/dbtests/query_stage_cached_plan.cpp +++ b/src/mongo/dbtests/query_stage_cached_plan.cpp @@ -35,6 +35,7 @@ #include "mongo/db/db_raii.h" #include "mongo/db/jsobj.h" #include "mongo/db/json.h" +#include "mongo/db/matcher/extensions_callback_disallow_extensions.h" #include "mongo/db/operation_context_impl.h" #include "mongo/db/query/canonical_query.h" #include "mongo/db/query/get_executor.h" @@ -111,7 +112,8 @@ public: ASSERT(collection); // Query can be answered by either index on "a" or index on "b". - auto statusWithCQ = CanonicalQuery::canonicalize(nss, fromjson("{a: {$gte: 8}, b: 1}")); + auto statusWithCQ = CanonicalQuery::canonicalize( + nss, fromjson("{a: {$gte: 8}, b: 1}"), ExtensionsCallbackDisallowExtensions()); ASSERT_OK(statusWithCQ.getStatus()); const std::unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue()); @@ -175,7 +177,8 @@ public: ASSERT(collection); // Query can be answered by either index on "a" or index on "b". - auto statusWithCQ = CanonicalQuery::canonicalize(nss, fromjson("{a: {$gte: 8}, b: 1}")); + auto statusWithCQ = CanonicalQuery::canonicalize( + nss, fromjson("{a: {$gte: 8}, b: 1}"), ExtensionsCallbackDisallowExtensions()); ASSERT_OK(statusWithCQ.getStatus()); const std::unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue()); |