```
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

```
assert(analyzed_join.getClauses().size() == or_func->arguments->children.size());
        }
        else
        {
            analyzed_join.addDisjunct();
            CollectJoinOnKeysVisitor(data).visit(table_join.on_expression);
            assert(analyzed_join.oneDisjunct());
        }
        if (analyzed_join.getClauses().empty())
                throw DB::Exception(ErrorCodes::INVALID_JOIN_ON_EXPRESSION,
                                    "Cannot get JOIN keys from JOIN ON section: '{}'",
                                    queryToString(table_join.on_expression));
        for (const auto & onexpr : analyzed_join.getClauses())
        {
            if (onexpr.key_names_left.empty())
                throw DB::Exception(ErrorCodes::INVALID_JOIN_ON_EXPRESSION,
                                    "Cannot get JOIN keys from JOIN ON section: '{}'",
                                    queryToString(table_join.on_expression));
        }
        if (is_asof)
        {
            if (!analyzed_join.oneDisjunct())
                throw DB::Exception(ErrorCodes::NOT_IMPLEMENTED, "ASOF join doesn't support multiple ORs for keys in JOIN ON section");
            data.asofToJoinKeys();
        }
        if (!analyzed_join.oneDisjunct() && !analyzed_join.forceHashJoin())
            throw DB::Exception(ErrorCodes::NOT_IMPLEMENTED, "Only `hash` join supports multiple ORs for keys in JOIN ON section");
    }
}
std::vector<const ASTFunction *> getAggregates(ASTPtr & query, const ASTSelectQuery & select_query)