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 

data_path_in_backup,
                             part_name,
                             part_info = std::move(part_info),
                             filenames = std::move(filenames),
                             reservation,
                             increment]()
        {
            auto disk = reservation->getDisk();
            auto temp_part_dir_owner = std::make_shared<TemporaryFileOnDisk>(disk, relative_data_path + "restoring_" + part_name + "_");
            String temp_part_dir = temp_part_dir_owner->getPath();
            disk->createDirectories(temp_part_dir);
            assert(temp_part_dir.starts_with(relative_data_path));
            String relative_temp_part_dir = temp_part_dir.substr(relative_data_path.size());
            for (const String & filename : filenames)
            {
                auto backup_entry = backup->readFile(data_path_in_backup + part_name + "/" + filename);
                auto read_buffer = backup_entry->getReadBuffer();
                auto write_buffer = disk->writeFile(temp_part_dir + "/" + filename);
                copyData(*read_buffer, *write_buffer);
            }
            auto single_disk_volume = std::make_shared<SingleDiskVolume>(disk->getName(), disk, 0);
            auto part = createPart(part_name, *part_info, single_disk_volume, relative_temp_part_dir);
            part->loadColumnsChecksumsIndexes(false, true);
            renameTempPartAndAdd(part, increment);
        };
        restore_tasks.emplace_back(std::move(restore_task));
    }
    return restore_tasks;
}
String MergeTreeData::getPartitionIDFromQuery(const ASTPtr & ast, ContextPtr local_context) const