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

```
all_commands_can_be_skipped = false;
        }
        else
            all_commands_can_be_skipped = false;
    }
    if (all_commands_can_be_skipped)
        return false;
    context_copy->setSetting("max_streams_to_max_threads_ratio", 1);
    context_copy->setSetting("max_threads", 1);
    ASTPtr select_query = prepareQueryAffectedAST(commands, storage, context_copy);
    
    
    
    InterpreterSelectQuery interpreter(select_query, context_copy, storage, metadata_snapshot, SelectQueryOptions().ignoreLimits());
    auto io = interpreter.execute();
    PullingPipelineExecutor executor(io.pipeline);
    Block block;
    while (!block.rows())
        executor.pull(block);
    if (!block.rows())
        return false;
    else if (block.rows() != 1)
        throw Exception("count() expression returned " + toString(block.rows()) + " rows, not 1",
            ErrorCodes::LOGICAL_ERROR);
    Block tmp_block;
    while (executor.pull(tmp_block));
    auto count = (*block.getByName("count()").column)[0].get<UInt64>();
    return count != 0;
}
ASTPtr getPartitionAndPredicateExpressionForMutationCommand(