summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2017-09-01 16:54:54 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2017-09-05 09:43:23 -0400
commita644bf58213f0786b8415277c1d54277b4f14581 (patch)
tree030ffc6e840bcce0e2f4235337a657e652dfe50e
parentb995f101491fce1f834f2875093ac8f0a6270e60 (diff)
downloadmongo-a644bf58213f0786b8415277c1d54277b4f14581.tar.gz
SERVER-30925 DocumentSourceSort::getMergeSource() should fully initialize source
-rw-r--r--src/mongo/db/pipeline/document_source_sort.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/document_source_sort.cpp b/src/mongo/db/pipeline/document_source_sort.cpp
index fd113a9c386..54cf67a97a6 100644
--- a/src/mongo/db/pipeline/document_source_sort.cpp
+++ b/src/mongo/db/pipeline/document_source_sort.cpp
@@ -517,7 +517,12 @@ intrusive_ptr<DocumentSource> DocumentSourceSort::getMergeSource() {
verify(!_mergingPresorted);
intrusive_ptr<DocumentSourceSort> other = new DocumentSourceSort(pExpCtx);
other->_sortPattern = _sortPattern;
+ other->_sortKeyGen = SortKeyGenerator{
+ other->sortKeyPattern(SortKeySerialization::kForPipelineSerialization).toBson(),
+ pExpCtx->getCollator()};
+ other->_paths = _paths;
other->limitSrc = limitSrc;
+ other->_maxMemoryUsageBytes = _maxMemoryUsageBytes;
other->_mergingPresorted = true;
other->_rawSort = _rawSort;
return other;