From 015f840701e270e42514e53a3def41d796d414a6 Mon Sep 17 00:00:00 2001 From: David Storch Date: Mon, 18 Jul 2016 21:32:00 -0400 Subject: SERVER-23349 require a collator for Document::compare() and Value::compare() Includes making aggregation $sort respect the collation. --- src/mongo/db/pipeline/accumulator_test.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mongo/db/pipeline/accumulator_test.cpp') diff --git a/src/mongo/db/pipeline/accumulator_test.cpp b/src/mongo/db/pipeline/accumulator_test.cpp index 8fad2b0095d..f903e897edc 100644 --- a/src/mongo/db/pipeline/accumulator_test.cpp +++ b/src/mongo/db/pipeline/accumulator_test.cpp @@ -49,11 +49,13 @@ static void assertExpectedResults( std::string accumulator, std::initializer_list, Value>> operations) { auto factory = Accumulator::getFactory(accumulator); + intrusive_ptr expCtx(new ExpressionContext()); for (auto&& op : operations) { try { // Asserts that result equals expected result when not sharded. { boost::intrusive_ptr accum = factory(); + accum->injectExpressionContext(expCtx); for (auto&& val : op.first) { accum->process(val, false); } @@ -65,7 +67,9 @@ static void assertExpectedResults( // Asserts that result equals expected result when all input is on one shard. { boost::intrusive_ptr accum = factory(); + accum->injectExpressionContext(expCtx); boost::intrusive_ptr shard = factory(); + shard->injectExpressionContext(expCtx); for (auto&& val : op.first) { shard->process(val, false); } @@ -78,8 +82,10 @@ static void assertExpectedResults( // Asserts that result equals expected result when each input is on a separate shard. { boost::intrusive_ptr accum = factory(); + accum->injectExpressionContext(expCtx); for (auto&& val : op.first) { boost::intrusive_ptr shard = factory(); + shard->injectExpressionContext(expCtx); shard->process(val, false); accum->process(shard->getValue(true), true); } -- cgit v1.2.1