diff options
author | Bernard Gorman <bernard.gorman@gmail.com> | 2017-09-21 02:22:00 -0400 |
---|---|---|
committer | Bernard Gorman <bernard.gorman@gmail.com> | 2017-09-24 15:59:10 -0400 |
commit | 21f5028d4404ea9584d53bdb81dd63ca8a505d6f (patch) | |
tree | ec6e458b171de330c0e4756603ba95ba3df06834 /src/mongo/db/pipeline/document_source_check_resume_token_test.cpp | |
parent | 280981d3a4cadeb91da9fd69864924e61d7ef99a (diff) | |
download | mongo-21f5028d4404ea9584d53bdb81dd63ca8a505d6f.tar.gz |
SERVER-30399 Add caching for $lookup non-correlated sub-pipeline prefix
Diffstat (limited to 'src/mongo/db/pipeline/document_source_check_resume_token_test.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_check_resume_token_test.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp b/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp index 133cffec12c..72e236ba870 100644 --- a/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp +++ b/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp @@ -236,18 +236,30 @@ public: StatusWith<std::unique_ptr<Pipeline, Pipeline::Deleter>> makePipeline( const std::vector<BSONObj>& rawPipeline, - const boost::intrusive_ptr<ExpressionContext>& expCtx) final { + const boost::intrusive_ptr<ExpressionContext>& expCtx, + const MakePipelineOptions opts) final { auto pipeline = Pipeline::parse(rawPipeline, expCtx); if (!pipeline.isOK()) { return pipeline.getStatus(); } - pipeline.getValue()->addInitialSource(DocumentSourceMock::create(_mockResults)); - pipeline.getValue()->optimizePipeline(); + if (opts.optimize) { + pipeline.getValue()->optimizePipeline(); + } + + if (opts.attachCursorSource) { + uassertStatusOK(attachCursorSourceToPipeline(expCtx, pipeline.getValue().get())); + } return pipeline; } + Status attachCursorSourceToPipeline(const boost::intrusive_ptr<ExpressionContext>& expCtx, + Pipeline* pipeline) final { + pipeline->addInitialSource(DocumentSourceMock::create(_mockResults)); + return Status::OK(); + } + private: deque<DocumentSource::GetNextResult> _mockResults; }; |