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

```
stages.emplace_back(context);
            NameSet affected_materialized;
            for (const auto & kv : command.column_to_update_expression)
            {
                const String & column = kv.first;
                auto materialized_it = column_to_affected_materialized.find(column);
                if (materialized_it != column_to_affected_materialized.end())
                {
                    for (const String & mat_column : materialized_it->second)
                        affected_materialized.emplace(mat_column);
                }
                
                
                
                
                
                
                
                
                
                const auto & type = columns_desc.getPhysical(column).type;
                auto type_literal = std::make_shared<ASTLiteral>(type->getName());
                const auto & update_expr = kv.second;
                ASTPtr condition = getPartitionAndPredicateExpressionForMutationCommand(command);
                
                if (isArray(type) && !Nested::splitName(column).second.empty())
                {
                    std::shared_ptr<ASTFunction> function = nullptr;
                    auto nested_update_exprs = getExpressionsOfUpdatedNestedSubcolumns(column, all_columns, command.column_to_update_expression);
                    if (!nested_update_exprs)