I tried to rename a key column in a MergeTree table. It does not work, and 20.4 is very clear about the reason. 
20.5.2 is complaining about non-existing column with the old name, suggesting there is a column with the new name:
```
ALTER TABLE rename_key
    RENAME COLUMN key TO new

Received exception from server (version 20.4.6):
Code: 44. DB::Exception: Received from localhost:9000. 
DB::Exception: Trying to ALTER RENAME key key column which is a part of key expression.

Received exception from server (version 20.5.2):
Code: 47. DB::Exception: Received from localhost:9000. 
DB::Exception: Missing columns: 'key' while processing query: 'key', required columns: 'key', source columns: 'value' 'new' 'date'.
```
The message hasn't changed for the partition key:
```
ALTER TABLE rename_key
    RENAME COLUMN date TO new

Received exception from server (version 20.4.6):
Code: 44. DB::Exception: Received from localhost:9000. 
DB::Exception: Trying to ALTER RENAME key date column which is a part of key expression.

Received exception from server (version 20.5.2):
Code: 524. DB::Exception: Received from localhost:9000. 
DB::Exception: Trying to ALTER RENAME key date column which is a part of key expression.
```
The table:
```
CREATE TABLE rename_key
(
    `date` Date,
    `key` UInt64,
    `value` String
)
ENGINE = MergeTree()
PARTITION BY date
ORDER BY key
```

[this](const ASTPtr & constraint_ast)
                {
                    return constraint_ast->as<ASTConstraintDeclaration &>().name == constraint_name;
                });
        if (erase_it == metadata.constraints.constraints.end())
        {
            if (if_exists)
                return;
            throw Exception("Wrong constraint name. Cannot find constraint `" + constraint_name + "` to drop.",
                    ErrorCodes::BAD_ARGUMENTS);
        }
        metadata.constraints.constraints.erase(erase_it);
    }
    else if (type == MODIFY_TTL)
    {
        metadata.table_ttl = TTLTableDescription::getTTLForTableFromAST(ttl, metadata.columns, context, metadata.primary_key);
    }
    else if (type == MODIFY_QUERY)
    {
        metadata.select = SelectQueryDescription::getSelectQueryFromASTForMatView(select, context);
    }
    else if (type == MODIFY_SETTING)
    {
        auto & settings_from_storage = metadata.settings_changes->as<ASTSetQuery &>().changes;
        for (const auto & change : settings_changes)
        {
            auto finder = [&change](const SettingChange & c) { return c.name == change.name; };
            auto it = std::find_if(settings_from_storage.begin(), settings_from_storage.end(), finder);
            if (it != settings_from_storage.end())
                it->value = change.value;