diff options
Diffstat (limited to 'src/mongo/db/query/internal_plans.cpp')
| -rw-r--r-- | src/mongo/db/query/internal_plans.cpp | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/src/mongo/db/query/internal_plans.cpp b/src/mongo/db/query/internal_plans.cpp index 78820eb8111..04f70b1d2cc 100644 --- a/src/mongo/db/query/internal_plans.cpp +++ b/src/mongo/db/query/internal_plans.cpp @@ -123,8 +123,7 @@ CollectionScanParams createCollectionScanParams( boost::optional<RecordId> resumeAfterRecordId, boost::optional<RecordIdBound> minRecord, boost::optional<RecordIdBound> maxRecord, - CollectionScanParams::ScanBoundInclusion boundInclusion, - bool shouldReturnEofOnFilterMismatch) { + CollectionScanParams::ScanBoundInclusion boundInclusion) { const auto& collection = *coll; invariant(collection); @@ -140,7 +139,6 @@ CollectionScanParams createCollectionScanParams( params.direction = CollectionScanParams::BACKWARD; } params.boundInclusion = boundInclusion; - params.shouldReturnEofOnFilterMismatch = shouldReturnEofOnFilterMismatch; return params; } } // namespace @@ -153,8 +151,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::collection boost::optional<RecordId> resumeAfterRecordId, boost::optional<RecordIdBound> minRecord, boost::optional<RecordIdBound> maxRecord, - CollectionScanParams::ScanBoundInclusion boundInclusion, - bool shouldReturnEofOnFilterMismatch) { + CollectionScanParams::ScanBoundInclusion boundInclusion) { const auto& collection = *coll; invariant(collection); @@ -170,8 +167,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::collection resumeAfterRecordId, minRecord, maxRecord, - boundInclusion, - shouldReturnEofOnFilterMismatch); + boundInclusion); auto cs = _collectionScan(expCtx, ws.get(), &collection, collScanParams); @@ -222,19 +218,11 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::deleteWith boost::optional<RecordIdBound> minRecord, boost::optional<RecordIdBound> maxRecord, CollectionScanParams::ScanBoundInclusion boundInclusion, - std::unique_ptr<BatchedDeleteStageBatchParams> batchedDeleteParams, - const MatchExpression* filter, - bool shouldReturnEofOnFilterMismatch) { + boost::optional<std::unique_ptr<BatchedDeleteStageBatchParams>> batchParams) { const auto& collection = *coll; invariant(collection); - if (shouldReturnEofOnFilterMismatch) { - tassert(7010801, - "MatchExpression filter must be provided when 'shouldReturnEofOnFilterMismatch' is " - "set to true ", - filter); - } - auto ws = std::make_unique<WorkingSet>(); + auto expCtx = make_intrusive<ExpressionContext>( opCtx, std::unique_ptr<CollatorInterface>(nullptr), collection->ns()); @@ -249,15 +237,14 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::deleteWith boost::none /* resumeAfterId */, minRecord, maxRecord, - boundInclusion, - shouldReturnEofOnFilterMismatch); + boundInclusion); - auto root = _collectionScan(expCtx, ws.get(), &collection, collScanParams, filter); + auto root = _collectionScan(expCtx, ws.get(), &collection, collScanParams); - if (batchedDeleteParams) { + if (batchParams) { root = std::make_unique<BatchedDeleteStage>(expCtx.get(), std::move(params), - std::move(batchedDeleteParams), + std::move(*batchParams), ws.get(), collection, root.release()); @@ -467,13 +454,12 @@ std::unique_ptr<PlanStage> InternalPlanner::_collectionScan( const boost::intrusive_ptr<ExpressionContext>& expCtx, WorkingSet* ws, const CollectionPtr* coll, - const CollectionScanParams& params, - const MatchExpression* filter) { + const CollectionScanParams& params) { const auto& collection = *coll; invariant(collection); - return std::make_unique<CollectionScan>(expCtx.get(), collection, params, ws, filter); + return std::make_unique<CollectionScan>(expCtx.get(), collection, params, ws, nullptr); } std::unique_ptr<PlanStage> InternalPlanner::_indexScan( |
