summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_sequential_document_cache.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-14 14:26:38 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-14 14:26:38 -0300
commit294bc6ecabf14c09c9bc8644704921dcf97cb44e (patch)
tree279b1e0bab53901a1647ac63c1c724f0f789a663 /src/mongo/db/pipeline/document_source_sequential_document_cache.cpp
parent70be7c27a251621187a1de533462ae2bb1e3bd39 (diff)
parent1e917fd798aa25b7066d4b414b51184f13d5a092 (diff)
Update upstream source from tag 'upstream/6.0.10'debian/6.0.10-1
Update to upstream version '6.0.10' with Debian dir 2d176fa254eee97b139f712fec5709641335a8c3
Diffstat (limited to 'src/mongo/db/pipeline/document_source_sequential_document_cache.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_sequential_document_cache.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source_sequential_document_cache.cpp b/src/mongo/db/pipeline/document_source_sequential_document_cache.cpp
index 33c32f096b3..39a13272df6 100644
--- a/src/mongo/db/pipeline/document_source_sequential_document_cache.cpp
+++ b/src/mongo/db/pipeline/document_source_sequential_document_cache.cpp
@@ -41,7 +41,6 @@ DocumentSourceSequentialDocumentCache::DocumentSourceSequentialDocumentCache(
const boost::intrusive_ptr<ExpressionContext>& expCtx, SequentialDocumentCache* cache)
: DocumentSource(kStageName, expCtx), _cache(cache) {
invariant(_cache);
- invariant(!_cache->isAbandoned());
if (_cache->isServing()) {
_cache->restartIteration();
@@ -96,7 +95,7 @@ Pipeline::SourceContainer::iterator DocumentSourceSequentialDocumentCache::doOpt
_hasOptimizedPos = true;
// If the cache is the only stage in the pipeline, return immediately.
- if (itr == container->begin()) {
+ if (itr == container->begin() && std::next(itr) == container->end()) {
return container->end();
}