diff options
Diffstat (limited to 'src/mongo/db/pipeline/document_source_set_window_fields.cpp')
| -rw-r--r-- | src/mongo/db/pipeline/document_source_set_window_fields.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_set_window_fields.cpp b/src/mongo/db/pipeline/document_source_set_window_fields.cpp index 45223bb1cf4..73806992561 100644 --- a/src/mongo/db/pipeline/document_source_set_window_fields.cpp +++ b/src/mongo/db/pipeline/document_source_set_window_fields.cpp @@ -464,8 +464,12 @@ DocumentSource::GetNextResult DocumentSourceInternalSetWindowFields::doGetNext() return DocumentSource::GetNextResult::makeEOF(); auto curDoc = _iterator.current(); - // The only way we hit this case is if there are no documents, since otherwise _eof will be set. if (!curDoc) { + if (_iterator.isPaused()) { + return DocumentSource::GetNextResult::makePauseExecution(); + } + // The only way we hit this case is if there are no documents, since otherwise _eof will be + // set. _eof = true; return DocumentSource::GetNextResult::makeEOF(); } |
