I am reading clickhouse mutation code. In StorageMergeTree->selectPartsToMutate() function, there is a check 
`if (current_ast_elements + commands_size >= max_ast_elements)
                break;`

I think if there are many mutations then the check result will be true, so that it will skip the remaining mutations.
But the new part's mutation is set to the last one in mutation map, and it does not apply the remaining mutations actually.
`new_part_info.mutation = current_mutations_by_version.rbegin()->first;`

Then the new part will miss the remaining mutations in future mutation job.

I think it's wrong here. Am I right?

If it is right, I will submit a PR 

{
            auto & column = assert_cast<ColumnAggregateFunction &>(*partition_minmax_count_columns.back());
            auto func = column.getAggregateFunction();
            Arena & arena = column.createOrGetArena();
            size_t size_of_state = func->sizeOfData();
            size_t align_of_state = func->alignOfData();
            auto * place = arena.alignedAlloc(size_of_state, align_of_state);
            func->create(place);
            const AggregateFunctionCount & agg_count = assert_cast<const AggregateFunctionCount &>(*func);
            agg_count.set(place, part->rows_count);
            column.insertFrom(place);
        }
    }
    block.setColumns(std::move(partition_minmax_count_columns));
    Block res;
    for (const auto & name : required_columns)
    {
        if (virtual_columns_block.has(name))
            res.insert(virtual_columns_block.getByName(name));
        else if (block.has(name))
            res.insert(block.getByName(name));
        else
            throw Exception(
                ErrorCodes::LOGICAL_ERROR,
                "Cannot find column {} in minmax_count projection but query analysis still selects this projection. It's a bug",
                name);
    }
    return res;
}
std::optional<ProjectionCandidate> MergeTreeData::getQueryProcessingStageWithAggregateProjection(