summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/sbe/sbe_sorted_merge_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/sbe/sbe_sorted_merge_test.cpp')
-rw-r--r--src/mongo/db/exec/sbe/sbe_sorted_merge_test.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/db/exec/sbe/sbe_sorted_merge_test.cpp b/src/mongo/db/exec/sbe/sbe_sorted_merge_test.cpp
index df167bfbafa..37cad8d4532 100644
--- a/src/mongo/db/exec/sbe/sbe_sorted_merge_test.cpp
+++ b/src/mongo/db/exec/sbe/sbe_sorted_merge_test.cpp
@@ -59,9 +59,9 @@ public:
std::vector<std::unique_ptr<PlanStage>> inputScans;
std::vector<value::SlotVector> inputSlots;
for (auto&& array : inputStreams) {
- auto [tag, val] = makeValue(array);
+ auto [tag, val] = stage_builder::makeValue(array);
- auto [slotVector, scan] = generateMockScanMulti(numSlots, tag, val);
+ auto [slotVector, scan] = generateVirtualScanMulti(numSlots, tag, val);
inputScans.push_back(std::move(scan));
inputSlots.push_back(std::move(slotVector));
}
@@ -87,7 +87,8 @@ public:
outputVals,
kEmptyPlanNodeId);
- auto resultAccessors = prepareTree(sortedMerge.get(), outputVals);
+ auto ctx = makeCompileCtx();
+ auto resultAccessors = prepareTree(ctx.get(), sortedMerge.get(), outputVals);
return {resultAccessors, std::move(sortedMerge)};
}
@@ -116,7 +117,7 @@ TEST_F(SortedMergeStageTest, TwoChildrenBasicAscending) {
BSON_ARRAY(BSON_ARRAY(2 << 2) << BSON_ARRAY(4 << 4))},
std::vector<value::SortDirection>{value::SortDirection::Ascending});
- auto [expectedTag, expectedVal] = makeValue(BSON_ARRAY(1 << 2 << 3 << 4));
+ auto [expectedTag, expectedVal] = stage_builder::makeValue(BSON_ARRAY(1 << 2 << 3 << 4));
value::ValueGuard expectedGuard{expectedTag, expectedVal};
auto [resultsTag, resultsVal] = getAllResults(sortedMerge.get(), resultAccessors[0]);
@@ -131,7 +132,7 @@ TEST_F(SortedMergeStageTest, TwoChildrenBasicDescending) {
BSON_ARRAY(BSON_ARRAY(4 << 4) << BSON_ARRAY(2 << 2) << BSON_ARRAY(1 << 1))},
std::vector<value::SortDirection>{value::SortDirection::Descending});
- auto [expectedTag, expectedVal] = makeValue(BSON_ARRAY(5 << 4 << 3 << 2 << 1));
+ auto [expectedTag, expectedVal] = stage_builder::makeValue(BSON_ARRAY(5 << 4 << 3 << 2 << 1));
value::ValueGuard expectedGuard{expectedTag, expectedVal};
auto [resultsTag, resultsVal] = getAllResults(sortedMerge.get(), resultAccessors[0]);
@@ -145,7 +146,7 @@ TEST_F(SortedMergeStageTest, TwoChildrenOneEmpty) {
makeSortedMerge({BSONArray(), BSON_ARRAY(BSON_ARRAY(1 << 1) << BSON_ARRAY(2 << 2))},
std::vector<value::SortDirection>{value::SortDirection::Ascending});
- auto [expectedTag, expectedVal] = makeValue(BSON_ARRAY(1 << 2));
+ auto [expectedTag, expectedVal] = stage_builder::makeValue(BSON_ARRAY(1 << 2));
value::ValueGuard expectedGuard{expectedTag, expectedVal};
auto [resultsTag, resultsVal] = getAllResults(sortedMerge.get(), resultAccessors[0]);
@@ -160,7 +161,7 @@ TEST_F(SortedMergeStageTest, TwoChildrenWithDuplicates) {
BSON_ARRAY(BSON_ARRAY(1 << 1) << BSON_ARRAY(2 << 2))},
std::vector<value::SortDirection>{value::SortDirection::Ascending});
- auto [expectedTag, expectedVal] = makeValue(BSON_ARRAY(1 << 1 << 1 << 2));
+ auto [expectedTag, expectedVal] = stage_builder::makeValue(BSON_ARRAY(1 << 1 << 1 << 2));
value::ValueGuard expectedGuard{expectedTag, expectedVal};
auto [resultsTag, resultsVal] = getAllResults(sortedMerge.get(), resultAccessors[0]);
@@ -179,8 +180,8 @@ TEST_F(SortedMergeStageTest, FiveChildren) {
<< BSON_ARRAY(10 << 10) << BSON_ARRAY(11 << 11) << BSON_ARRAY(12 << 12))},
std::vector<value::SortDirection>{value::SortDirection::Ascending});
- auto [expectedTag, expectedVal] =
- makeValue(BSON_ARRAY(1 << 1 << 1 << 1 << 2 << 3 << 4 << 4 << 5 << 10 << 11 << 12));
+ auto [expectedTag, expectedVal] = stage_builder::makeValue(
+ BSON_ARRAY(1 << 1 << 1 << 1 << 2 << 3 << 4 << 4 << 5 << 10 << 11 << 12));
value::ValueGuard expectedGuard{expectedTag, expectedVal};
auto [resultsTag, resultsVal] = getAllResults(sortedMerge.get(), resultAccessors[0]);