0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-57005 Fix unpackbucket rewrite after optimizeEndOfPipeline

This commit is contained in:
Svilen Mihaylov 2021-05-17 11:01:29 -04:00 committed by Evergreen Agent
parent fcdc972cd6
commit 0e4ff78d3c

View File

@ -904,6 +904,10 @@ Pipeline::SourceContainer::iterator DocumentSourceInternalUnpackBucket::doOptimi
if (!_optimizedEndOfPipeline) {
_optimizedEndOfPipeline = true;
optimizeEndOfPipeline(itr, container);
if (std::next(itr) == container->end()) {
return container->end();
}
}
{
// Check if we can avoid unpacking if we have a group stage with min/max aggregates.