ClickHouse/dbms/tests/queries/0_stateless/mergetree_mutations.lib

21 lines
456 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
function wait_for_mutation()
{
local table=$1
local mutation_id=$2
for i in {1..100}
do
sleep 0.1
2018-09-06 10:49:36 +00:00
if [[ $(${CLICKHOUSE_CLIENT} --query="SELECT min(is_done) FROM system.mutations WHERE table='$table' AND mutation_id='$mutation_id'") -eq 1 ]]; then
break
fi
if [[ $i -eq 100 ]]; then
echo "Timed out while waiting for mutation to execute!"
fi
done
}