summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_planner_test_lib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/query_planner_test_lib.cpp')
-rw-r--r--src/mongo/db/query/query_planner_test_lib.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/query/query_planner_test_lib.cpp b/src/mongo/db/query/query_planner_test_lib.cpp
index c1920f821d0..377bbb791ae 100644
--- a/src/mongo/db/query/query_planner_test_lib.cpp
+++ b/src/mongo/db/query/query_planner_test_lib.cpp
@@ -36,6 +36,7 @@
#include "mongo/db/jsobj.h"
#include "mongo/db/json.h"
#include "mongo/db/matcher/expression_parser.h"
+#include "mongo/db/pipeline/expression_context_for_test.h"
#include "mongo/db/query/collation/collator_factory_mock.h"
#include "mongo/db/query/query_planner.h"
#include "mongo/db/query/query_solution.h"
@@ -66,8 +67,10 @@ bool filterMatches(const BSONObj& testFilter,
testCollator = std::move(collator.getValue());
}
+ boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest());
+ expCtx->setCollator(testCollator.get());
StatusWithMatchExpression statusWithMatcher =
- MatchExpressionParser::parse(testFilter, testCollator.get());
+ MatchExpressionParser::parse(testFilter, std::move(expCtx));
if (!statusWithMatcher.isOK()) {
return false;
}