```
DROP TABLE IF EXISTS foo;

CREATE TABLE foo (timestamp DateTime, x UInt64)
ENGINE = MergeTree PARTITION BY toYYYYMMDD(timestamp)
ORDER BY (timestamp);

INSERT INTO foo (timestamp, x) SELECT toDateTime('2020-01-01 00:05:00'), number from system.numbers_mt LIMIT 100;

SELECT count() FROM system.mutations; -- ok

ALTER TABLE foo UPDATE x = 1 WHERE x = (SELECT x from foo WHERE x = 1);

SELECT count() FROM system.mutations; -- stuck

```
result.collectUsedColumns(query, false);
    return std::make_shared<const TreeRewriterResult>(result);
}
void TreeRewriter::normalize(
    ASTPtr & query, Aliases & aliases, const NameSet & source_columns_set, bool ignore_alias, const Settings & settings, bool allow_self_aliases)
{
    UserDefinedSQLFunctionVisitor::Data data_user_defined_functions_visitor;
    UserDefinedSQLFunctionVisitor(data_user_defined_functions_visitor).visit(query);
    CustomizeCountDistinctVisitor::Data data_count_distinct{settings.count_distinct_implementation};
    CustomizeCountDistinctVisitor(data_count_distinct).visit(query);
    CustomizeCountIfDistinctVisitor::Data data_count_if_distinct{settings.count_distinct_implementation.toString() + "If"};
    CustomizeCountIfDistinctVisitor(data_count_if_distinct).visit(query);
    CustomizeIfDistinctVisitor::Data data_distinct_if{"DistinctIf"};
    CustomizeIfDistinctVisitor(data_distinct_if).visit(query);
    ExistsExpressionVisitor::Data exists;
    ExistsExpressionVisitor(exists).visit(query);
    if (settings.transform_null_in)
    {
        CustomizeInVisitor::Data data_null_in{"nullIn"};
        CustomizeInVisitor(data_null_in).visit(query);
        CustomizeNotInVisitor::Data data_not_null_in{"notNullIn"};
        CustomizeNotInVisitor(data_not_null_in).visit(query);
        CustomizeGlobalInVisitor::Data data_global_null_in{"globalNullIn"};
        CustomizeGlobalInVisitor(data_global_null_in).visit(query);
        CustomizeGlobalNotInVisitor::Data data_global_not_null_in{"globalNotNullIn"};
        CustomizeGlobalNotInVisitor(data_global_not_null_in).visit(query);
    }