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 

bool moveParts(const CurrentlyMovingPartsTaggerPtr & moving_tagger);
    
    CurrentlyMovingPartsTaggerPtr selectPartsForMove();
    
    CurrentlyMovingPartsTaggerPtr checkPartsForMove(const DataPartsVector & parts, SpacePtr space);
    bool canUsePolymorphicParts(const MergeTreeSettings & settings, String * out_reason = nullptr) const;
    std::mutex write_ahead_log_mutex;
    WriteAheadLogPtr write_ahead_log;
    virtual void startBackgroundMovesIfNeeded() = 0;
    bool allow_nullable_key{};
    void addPartContributionToDataVolume(const DataPartPtr & part);
    void removePartContributionToDataVolume(const DataPartPtr & part);
    void increaseDataVolume(size_t bytes, size_t rows, size_t parts);
    void decreaseDataVolume(size_t bytes, size_t rows, size_t parts);
    void setDataVolume(size_t bytes, size_t rows, size_t parts);
    std::atomic<size_t> total_active_size_bytes = 0;
    std::atomic<size_t> total_active_size_rows = 0;
    std::atomic<size_t> total_active_size_parts = 0;
    
    mutable std::set<String> query_id_set;
    mutable std::mutex query_id_set_mutex;
    
    MatcherFn getPartitionMatcher(const ASTPtr & partition, ContextPtr context) const;
    
    virtual std::unique_ptr<MergeTreeSettings> getDefaultSettings() const = 0;
    void loadDataPartsFromDisk(
        DataPartsVector & broken_parts_to_detach,
        DataPartsVector & duplicate_parts_to_remove,
        ThreadPool & pool,