ClickHouse/tests/queries/0_stateless/mergetree_mutations.lib
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

23 lines
554 B
Bash

#!/usr/bin/env bash
function wait_for_mutation()
{
local table=$1
local mutation_id=$2
local database=$3
database=${database:="${CLICKHOUSE_DATABASE}"}
for i in {1..100}
do
sleep 0.1
if [[ $(${CLICKHOUSE_CLIENT} --query="SELECT min(is_done) FROM system.mutations WHERE database='$database' AND 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
}