diff options
author | David Storch <david.storch@mongodb.com> | 2019-10-01 19:36:43 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-01 19:36:43 +0000 |
commit | 6d0a0e46b987dbc69a5694ff03d53d7e7e25b065 (patch) | |
tree | 65100de1652fcfebdc2569d8910972d2ae891fa4 /src/mongo/db/exec/sort_test.cpp | |
parent | 0187f0fed3630b3f519daeb7290f40a92b700691 (diff) | |
download | mongo-6d0a0e46b987dbc69a5694ff03d53d7e7e25b065.tar.gz |
SERVER-42182 Reimplement SortStage in terms of SortExecutor.
This consolidates the implementations of DocumentSourceSort
and SortStage to both use the same underlying sort execution
code. It also allows a future change to expose external sort
for find command (which currently requires
'enableTestCommands=true').
Diffstat (limited to 'src/mongo/db/exec/sort_test.cpp')
-rw-r--r-- | src/mongo/db/exec/sort_test.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mongo/db/exec/sort_test.cpp b/src/mongo/db/exec/sort_test.cpp index 349d3a7a1af..9e4494f27a6 100644 --- a/src/mongo/db/exec/sort_test.cpp +++ b/src/mongo/db/exec/sort_test.cpp @@ -109,8 +109,12 @@ public: auto sortKeyGen = std::make_unique<SortKeyGeneratorStage>( expCtx, std::move(queuedDataStage), &ws, sortPattern); - SortStage sort( - expCtx, &ws, sortPattern, limit, kMaxMemoryUsageBytes, std::move(sortKeyGen)); + SortStage sort(expCtx, + &ws, + SortPattern{sortPattern, expCtx}, + limit, + kMaxMemoryUsageBytes, + std::move(sortKeyGen)); WorkingSetID id = WorkingSet::INVALID_ID; PlanStage::StageState state = PlanStage::NEED_TIME; @@ -170,7 +174,12 @@ TEST_F(SortStageTest, SortEmptyWorkingSet) { auto sortKeyGen = std::make_unique<SortKeyGeneratorStage>(expCtx, std::move(queuedDataStage), &ws, BSONObj()); auto sortPattern = BSON("a" << 1); - SortStage sort(expCtx, &ws, sortPattern, 0u, kMaxMemoryUsageBytes, std::move(sortKeyGen)); + SortStage sort(expCtx, + &ws, + SortPattern{sortPattern, expCtx}, + 0u, + kMaxMemoryUsageBytes, + std::move(sortKeyGen)); // Check initial EOF state. ASSERT_FALSE(sort.isEOF()); |