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 

const StorageMetadataPtr & metadata_snapshot,
    const Names & required_columns,
    const SelectQueryInfo & query_info,
    const DataPartsVector & parts,
    DataPartsVector & normal_parts,
    ContextPtr query_context) const
{
    if (!metadata_snapshot->minmax_count_projection)
        throw Exception(
            "Cannot find the definition of minmax_count projection but it's used in current query. It's a bug",
            ErrorCodes::LOGICAL_ERROR);
    auto block = metadata_snapshot->minmax_count_projection->sample_block.cloneEmpty();
    bool need_primary_key_max_column = false;
    const auto & primary_key_max_column_name = metadata_snapshot->minmax_count_projection->primary_key_max_column_name;
    if (!primary_key_max_column_name.empty())
    {
        need_primary_key_max_column = std::any_of(
            required_columns.begin(), required_columns.end(), [&](const auto & name) { return primary_key_max_column_name == name; });
    }
    auto partition_minmax_count_columns = block.mutateColumns();