summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/query_stage_multiplan.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2017-09-14 16:40:46 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2017-09-29 09:30:56 -0400
commite0a505e2a8bfe59d8bdfc4e5a25aef4861d58fcf (patch)
tree237c46d1e4fd1080ac58b890485fb6197d53484c /src/mongo/dbtests/query_stage_multiplan.cpp
parent026b5f6f38c883c48d063ac8ee736f7330227281 (diff)
downloadmongo-e0a505e2a8bfe59d8bdfc4e5a25aef4861d58fcf.tar.gz
SERVER-30731 MatchExpressionParser::parse() should require an ExpressionContext
Diffstat (limited to 'src/mongo/dbtests/query_stage_multiplan.cpp')
-rw-r--r--src/mongo/dbtests/query_stage_multiplan.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/dbtests/query_stage_multiplan.cpp b/src/mongo/dbtests/query_stage_multiplan.cpp
index dd1fc50b924..a76b67ac9d0 100644
--- a/src/mongo/dbtests/query_stage_multiplan.cpp
+++ b/src/mongo/dbtests/query_stage_multiplan.cpp
@@ -164,7 +164,9 @@ TEST_F(QueryStageMultiPlanTest, MPSCollectionScanVsHighlySelectiveIXScan) {
// Make the filter.
BSONObj filterObj = BSON("foo" << 7);
const CollatorInterface* collator = nullptr;
- StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, collator);
+ const boost::intrusive_ptr<ExpressionContext> expCtx(
+ new ExpressionContext(_opCtx.get(), collator));
+ StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, expCtx);
verify(statusWithMatcher.isOK());
unique_ptr<MatchExpression> filter = std::move(statusWithMatcher.getValue());
// Make the stage.
@@ -458,7 +460,9 @@ TEST_F(QueryStageMultiPlanTest, ShouldReportErrorIfExceedsTimeLimitDuringPlannin
// Make the filter.
BSONObj filterObj = BSON("foo" << 7);
const CollatorInterface* collator = nullptr;
- StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, collator);
+ const boost::intrusive_ptr<ExpressionContext> expCtx(
+ new ExpressionContext(_opCtx.get(), collator));
+ StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, expCtx);
verify(statusWithMatcher.isOK());
unique_ptr<MatchExpression> filter = std::move(statusWithMatcher.getValue());
// Make the stage.
@@ -521,7 +525,9 @@ TEST_F(QueryStageMultiPlanTest, ShouldReportErrorIfKilledDuringPlanning) {
// Make the filter.
BSONObj filterObj = BSON("foo" << 7);
const CollatorInterface* collator = nullptr;
- StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, collator);
+ const boost::intrusive_ptr<ExpressionContext> expCtx(
+ new ExpressionContext(_opCtx.get(), collator));
+ StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, expCtx);
verify(statusWithMatcher.isOK());
unique_ptr<MatchExpression> filter = std::move(statusWithMatcher.getValue());
// Make the stage.