summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/plan_executor_invalidation_test.cpp
diff options
context:
space:
mode:
authorIan Boros <ian.boros@mongodb.com>2020-01-30 13:10:55 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-28 22:16:41 +0000
commitcfa5c05fa1855fb1a04cb3a6e2eb10a7e82bf726 (patch)
tree7ab1e1ce8e2edd6837952c131fe14d43a0633235 /src/mongo/dbtests/plan_executor_invalidation_test.cpp
parent793ae32c597f197b6445750aa9bfdaabc206132d (diff)
downloadmongo-cfa5c05fa1855fb1a04cb3a6e2eb10a7e82bf726.tar.gz
SERVER-45406 Plumb ExpressionContext through PlanStage
This patch includes also moves ownership of the collator to the ExpressionContext.
Diffstat (limited to 'src/mongo/dbtests/plan_executor_invalidation_test.cpp')
-rw-r--r--src/mongo/dbtests/plan_executor_invalidation_test.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/dbtests/plan_executor_invalidation_test.cpp b/src/mongo/dbtests/plan_executor_invalidation_test.cpp
index 06b33cc30d4..a7e949465bd 100644
--- a/src/mongo/dbtests/plan_executor_invalidation_test.cpp
+++ b/src/mongo/dbtests/plan_executor_invalidation_test.cpp
@@ -58,7 +58,8 @@ static const NamespaceString nss("unittests.PlanExecutorInvalidationTest");
*/
class PlanExecutorInvalidationTest : public unittest::Test {
public:
- PlanExecutorInvalidationTest() : _client(&_opCtx) {
+ PlanExecutorInvalidationTest()
+ : _client(&_opCtx), _expCtx(make_intrusive<ExpressionContext>(&_opCtx, nullptr, nss)) {
_ctx.reset(new dbtests::WriteContextForTests(&_opCtx, nss.ns()));
_client.dropCollection(nss.ns());
@@ -76,7 +77,7 @@ public:
params.direction = CollectionScanParams::FORWARD;
params.tailable = false;
unique_ptr<CollectionScan> scan(
- new CollectionScan(&_opCtx, collection(), params, ws.get(), nullptr));
+ new CollectionScan(_expCtx.get(), collection(), params, ws.get(), nullptr));
// Create a plan executor to hold it
auto qr = std::make_unique<QueryRequest>(nss);
@@ -131,6 +132,8 @@ public:
OperationContext& _opCtx = *_opCtxPtr;
unique_ptr<dbtests::WriteContextForTests> _ctx;
DBDirectClient _client;
+
+ boost::intrusive_ptr<ExpressionContext> _expCtx;
};
TEST_F(PlanExecutorInvalidationTest, ExecutorToleratesDeletedDocumentsDuringYield) {