mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
shellcheck --check-sourced --external-sources --severity style --exclude SC1071 --format diff *.sh ../1_stateful/*.sh | git apply
This commit is contained in:
parent
57fdd1f5b7
commit
0c33498df1
@ -18,9 +18,9 @@ ${CLICKHOUSE_CLIENT} --query="INSERT INTO test_optimize_exception_replicated VAL
|
||||
${CLICKHOUSE_CLIENT} --optimize_throw_if_noop 1 --query="OPTIMIZE TABLE test_optimize_exception PARTITION 201709 FINAL"
|
||||
${CLICKHOUSE_CLIENT} --optimize_throw_if_noop 1 --query="OPTIMIZE TABLE test_optimize_exception_replicated PARTITION 201709 FINAL"
|
||||
|
||||
echo "`"${CLICKHOUSE_CLIENT}" --optimize_throw_if_noop 1 --server_logs_file=/dev/null --query="OPTIMIZE TABLE test_optimize_exception PARTITION 201710" 2>&1`" \
|
||||
echo "$("${CLICKHOUSE_CLIENT}" --optimize_throw_if_noop 1 --server_logs_file=/dev/null --query="OPTIMIZE TABLE test_optimize_exception PARTITION 201710" 2>&1)" \
|
||||
| grep -c 'Code: 388. DB::Exception: .* DB::Exception: .* Cannot select parts for optimization'
|
||||
echo "`"${CLICKHOUSE_CLIENT}" --optimize_throw_if_noop 1 --server_logs_file=/dev/null --query="OPTIMIZE TABLE test_optimize_exception_replicated PARTITION 201710" 2>&1`" \
|
||||
echo "$("${CLICKHOUSE_CLIENT}" --optimize_throw_if_noop 1 --server_logs_file=/dev/null --query="OPTIMIZE TABLE test_optimize_exception_replicated PARTITION 201710" 2>&1)" \
|
||||
| grep -c 'Code: 388. DB::Exception: .* DB::Exception:.* Cannot select parts for optimization'
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query="DROP TABLE test_optimize_exception NO DELAY"
|
||||
|
@ -66,7 +66,7 @@ function test {
|
||||
echo
|
||||
}
|
||||
|
||||
merged_rows_0=`$CLICKHOUSE_CLIENT -q "select value from system.events where event = 'MergedRows'"`
|
||||
merged_rows_0=$($CLICKHOUSE_CLIENT -q "select value from system.events where event = 'MergedRows'")
|
||||
|
||||
test 8191 8191
|
||||
test 8191 8192
|
||||
@ -81,7 +81,7 @@ test 8193 8194
|
||||
test 8194 8193
|
||||
test 8194 8194
|
||||
|
||||
merged_rows_1=`$CLICKHOUSE_CLIENT -q "select value from system.events where event = 'MergedRows'"`
|
||||
merged_rows_1=$($CLICKHOUSE_CLIENT -q "select value from system.events where event = 'MergedRows'")
|
||||
[[ $merged_rows_1 -le $merged_rows_0 ]]
|
||||
|
||||
cleanup
|
||||
|
@ -59,4 +59,4 @@ ${CLICKHOUSE_LOCAL} -q "CREATE TABLE sophisticated_default
|
||||
) ENGINE = Memory; SELECT count() FROM system.tables WHERE name='sophisticated_default';"
|
||||
|
||||
# Help is not skipped
|
||||
[[ `${CLICKHOUSE_LOCAL} --help | wc -l` -gt 100 ]]
|
||||
[[ $(${CLICKHOUSE_LOCAL} --help | wc -l) -gt 100 ]]
|
||||
|
@ -5,7 +5,7 @@ set -e
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
for i in `seq -w 0 2 20`; do
|
||||
for i in $(seq -w 0 2 20); do
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS merge_item_$i"
|
||||
$CLICKHOUSE_CLIENT -q "CREATE TABLE merge_item_$i (d Int8) ENGINE = Memory"
|
||||
$CLICKHOUSE_CLIENT -q "INSERT INTO merge_item_$i VALUES ($i)"
|
||||
@ -16,4 +16,4 @@ $CLICKHOUSE_CLIENT -q "CREATE TABLE merge_storage (d Int8) ENGINE = Merge('${CLI
|
||||
$CLICKHOUSE_CLIENT --max_threads=1 -q "SELECT _table, d FROM merge_storage WHERE _table LIKE 'merge_item_1%' ORDER BY _table"
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS merge_storage"
|
||||
|
||||
for i in `seq -w 0 2 20`; do $CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS merge_item_$i"; done
|
||||
for i in $(seq -w 0 2 20); do $CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS merge_item_$i"; done
|
||||
|
@ -11,7 +11,7 @@ function query {
|
||||
}
|
||||
|
||||
function ch_url() {
|
||||
${CLICKHOUSE_CURL_COMMAND} -q -sS "${CLICKHOUSE_URL}&max_block_size=$max_block_size&$1" -d "`query "$2"`"
|
||||
${CLICKHOUSE_CURL_COMMAND} -q -sS "${CLICKHOUSE_URL}&max_block_size=$max_block_size&$1" -d "$(query "$2")"
|
||||
}
|
||||
|
||||
|
||||
@ -21,17 +21,17 @@ exception_pattern="displayText() = DB::Exception:[[:print:]]*"
|
||||
|
||||
function check_only_exception() {
|
||||
local res
|
||||
res=`ch_url "$1" "$2"`
|
||||
res=$(ch_url "$1" "$2")
|
||||
#(echo "$res")
|
||||
#(echo "$res" | wc -l)
|
||||
#(echo "$res" | grep -c "$exception_pattern")
|
||||
[[ `echo "$res" | wc -l` -eq 1 ]] || echo FAIL 1 "$@"
|
||||
[[ $(echo "$res" | wc -l) -eq 1 ]] || echo FAIL 1 "$@"
|
||||
[[ $(echo "$res" | grep -c "$exception_pattern") -eq 1 ]] || echo FAIL 2 "$@"
|
||||
}
|
||||
|
||||
function check_last_line_exception() {
|
||||
local res
|
||||
res=`ch_url "$1" "$2"`
|
||||
res=$(ch_url "$1" "$2")
|
||||
#echo "$res" > res
|
||||
#echo "$res" | wc -c
|
||||
#echo "$res" | tail -n -2
|
||||
@ -59,13 +59,13 @@ check_exception_handling
|
||||
|
||||
# Tune setting to speed up combinatorial test
|
||||
max_block_size=500000
|
||||
corner_sizes="1048576 `seq 500000 1000000 3500000`"
|
||||
corner_sizes="1048576 $(seq 500000 1000000 3500000)"
|
||||
|
||||
|
||||
# Check HTTP results with $CLICKHOUSE_CLIENT in normal case
|
||||
|
||||
function cmp_cli_and_http() {
|
||||
$CLICKHOUSE_CLIENT -q "`query "$1"`" > "${CLICKHOUSE_TMP}"/res1
|
||||
$CLICKHOUSE_CLIENT -q "$(query "$1")" > "${CLICKHOUSE_TMP}"/res1
|
||||
ch_url "buffer_size=$2&wait_end_of_query=0" "$1" > "${CLICKHOUSE_TMP}"/res2
|
||||
ch_url "buffer_size=$2&wait_end_of_query=1" "$1" > "${CLICKHOUSE_TMP}"/res3
|
||||
cmp "${CLICKHOUSE_TMP}"/res1 "${CLICKHOUSE_TMP}"/res2 && cmp "${CLICKHOUSE_TMP}"/res1 "${CLICKHOUSE_TMP}"/res3 || echo FAIL 5 "$@"
|
||||
@ -87,7 +87,7 @@ check_cli_and_http
|
||||
# Check HTTP internal compression in normal case
|
||||
|
||||
function cmp_http_compression() {
|
||||
$CLICKHOUSE_CLIENT -q "`query "$1"`" > "${CLICKHOUSE_TMP}"/res0
|
||||
$CLICKHOUSE_CLIENT -q "$(query "$1")" > "${CLICKHOUSE_TMP}"/res0
|
||||
ch_url 'compress=1' "$1" | "${CLICKHOUSE_BINARY}"-compressor --decompress > "${CLICKHOUSE_TMP}"/res1
|
||||
ch_url "compress=1&buffer_size=$2&wait_end_of_query=0" "$1" | "${CLICKHOUSE_BINARY}"-compressor --decompress > "${CLICKHOUSE_TMP}"/res2
|
||||
ch_url "compress=1&buffer_size=$2&wait_end_of_query=1" "$1" | "${CLICKHOUSE_BINARY}"-compressor --decompress > "${CLICKHOUSE_TMP}"/res3
|
||||
|
@ -70,7 +70,7 @@ number AS di10,
|
||||
[hex(number), hex(number+1)] AS \`n.s\`
|
||||
FROM system.numbers LIMIT $res_rows"
|
||||
|
||||
while [[ `get_num_parts` -ne 1 ]] ; do $CLICKHOUSE_CLIENT -q "OPTIMIZE TABLE $name PARTITION 197001" --server_logs_file=/dev/null; done
|
||||
while [[ $(get_num_parts) -ne 1 ]] ; do $CLICKHOUSE_CLIENT -q "OPTIMIZE TABLE $name PARTITION 197001" --server_logs_file=/dev/null; done
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "ALTER TABLE $name ADD COLUMN n.a Array(String)"
|
||||
$CLICKHOUSE_CLIENT -q "ALTER TABLE $name ADD COLUMN da Array(String) DEFAULT ['def']"
|
||||
@ -83,8 +83,8 @@ $CLICKHOUSE_CLIENT -q "ALTER TABLE $name MODIFY COLUMN da Array(String) DEFAULT
|
||||
$CLICKHOUSE_CLIENT -q "SELECT count(), sum(Sign), sum(ki = di05), sum(hex(ki) = ds), sum(ki = n.i[1]), sum([hex(ki), hex(ki+1)] = n.s) FROM $name"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT groupUniqArray(da), groupUniqArray(n.a) FROM $name"
|
||||
|
||||
hash_src=`$CLICKHOUSE_CLIENT --max_threads=1 -q "SELECT cityHash64(groupArray(ki)) FROM $name"`
|
||||
hash_ref=`$CLICKHOUSE_CLIENT --max_threads=1 -q "SELECT cityHash64(groupArray(ki)) FROM (SELECT number as ki FROM system.numbers LIMIT $res_rows)"`
|
||||
hash_src=$($CLICKHOUSE_CLIENT --max_threads=1 -q "SELECT cityHash64(groupArray(ki)) FROM $name")
|
||||
hash_ref=$($CLICKHOUSE_CLIENT --max_threads=1 -q "SELECT cityHash64(groupArray(ki)) FROM (SELECT number as ki FROM system.numbers LIMIT $res_rows)")
|
||||
echo $(( $hash_src - $hash_ref ))
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS $name"
|
||||
|
@ -35,8 +35,8 @@ $CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS nullable_prewhere"
|
||||
|
||||
# Depend on 00282_merging test
|
||||
|
||||
pushd "`dirname "$0"`" > /dev/null
|
||||
SCRIPTPATH=`pwd`
|
||||
pushd "$(dirname "$0")" > /dev/null
|
||||
SCRIPTPATH=$(pwd)
|
||||
popd > /dev/null
|
||||
#SCRIPTDIR=`dirname "$SCRIPTPATH"`
|
||||
SCRIPTDIR=$SCRIPTPATH
|
||||
|
@ -21,7 +21,7 @@ set -e
|
||||
$ch "INSERT INTO clear_column1 VALUES ('2000-01-01', 1, 'a'), ('2000-02-01', 2, 'b')"
|
||||
$ch "INSERT INTO clear_column1 VALUES ('2000-01-01', 3, 'c'), ('2000-02-01', 4, 'd')"
|
||||
|
||||
for _ in `seq 10`; do
|
||||
for _ in $(seq 10); do
|
||||
$ch "INSERT INTO clear_column1 VALUES ('2000-02-01', 0, ''), ('2000-02-01', 0, '')" & # insert into the same partition
|
||||
$ch "ALTER TABLE clear_column1 CLEAR COLUMN i IN PARTITION '200001'" --replication_alter_partitions_sync=2
|
||||
$ch "ALTER TABLE clear_column1 CLEAR COLUMN s IN PARTITION '200001'" --replication_alter_partitions_sync=2
|
||||
|
@ -55,7 +55,7 @@ check "$url$session&session_timeout=60" "$select" "Exception" 0 "60 second timeo
|
||||
check "$url""$session" "$select" "7777777" 1 "Failed to reuse session."
|
||||
# Workaround here
|
||||
# TODO: move the test to integration test or add readonly user to test environment
|
||||
if [[ -z `request "$url?user=readonly" "SELECT ''"` ]]; then
|
||||
if [[ -z $(request "$url?user=readonly" "SELECT ''") ]]; then
|
||||
# We have readonly user
|
||||
check "$url$session&user=readonly&session_check=1" "$select" "Exception.*Session not found" 1 "Session is accessable for another user."
|
||||
else
|
||||
|
@ -6,6 +6,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
( ${CLICKHOUSE_CURL} -s --head "${CLICKHOUSE_URL}&query=SELECT%201";
|
||||
${CLICKHOUSE_CURL} -s --head "${CLICKHOUSE_URL}&query=select+*+from+system.numbers+limit+1000000" ) | grep -v "Date:" | grep -v "X-ClickHouse-Server-Display-Name:" | grep -v "X-ClickHouse-Query-Id:" | grep -v "X-ClickHouse-Format:" | grep -v "X-ClickHouse-Timezone:"
|
||||
|
||||
if [[ `${CLICKHOUSE_CURL} -sS -X POST -I "${CLICKHOUSE_URL}&query=SELECT+1" | grep -c '411 Length Required'` -ne 1 ]]; then
|
||||
if [[ $(${CLICKHOUSE_CURL} -sS -X POST -I "${CLICKHOUSE_URL}&query=SELECT+1" | grep -c '411 Length Required') -ne 1 ]]; then
|
||||
echo FAIL
|
||||
fi
|
||||
|
@ -10,7 +10,7 @@ ${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test_00575;"
|
||||
${CLICKHOUSE_CLIENT} --query "CREATE TABLE test_00575 (dt Date DEFAULT now(), id UInt32, id2 UInt32 DEFAULT id + 1) ENGINE = MergeTree(dt, dt, 8192);"
|
||||
${CLICKHOUSE_CLIENT} --query "INSERT INTO test_00575(dt,id) VALUES ('2018-02-22',3), ('2018-02-22',4), ('2018-02-22',5);"
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test_00575 ORDER BY id;"
|
||||
echo "`"${CLICKHOUSE_CLIENT}" --query "ALTER TABLE test_00575 DROP COLUMN id;" --server_logs_file=/dev/null 2>&1 | grep -c "$exception_pattern"`"
|
||||
echo "$("${CLICKHOUSE_CLIENT}" --query "ALTER TABLE test_00575 DROP COLUMN id;" --server_logs_file=/dev/null 2>&1 | grep -c "$exception_pattern")"
|
||||
${CLICKHOUSE_CLIENT} --query "ALTER TABLE test_00575 DROP COLUMN id2;"
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test_00575 ORDER BY id;"
|
||||
${CLICKHOUSE_CLIENT} --query "ALTER TABLE test_00575 DROP COLUMN id;"
|
||||
|
@ -11,7 +11,7 @@ ${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test_view_00595;"
|
||||
${CLICKHOUSE_CLIENT} --query "CREATE TABLE test_00595 (s String) ENGINE = Log;"
|
||||
${CLICKHOUSE_CLIENT} --query "CREATE VIEW test_view_00595 AS SELECT * FROM test_00595;"
|
||||
|
||||
(( `${CLICKHOUSE_CLIENT} --query "INSERT INTO test_view_00595 VALUES('test_string');" 2>&1 | grep -c "$exception_pattern"` >= 1 )) && echo 1 || echo "NO MATCH"
|
||||
(( $(${CLICKHOUSE_CLIENT} --query "INSERT INTO test_view_00595 VALUES('test_string');" 2>&1 | grep -c "$exception_pattern") >= 1 )) && echo 1 || echo "NO MATCH"
|
||||
${CLICKHOUSE_CLIENT} --query "INSERT INTO test_00595 VALUES('test_string');"
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test_00595;"
|
||||
|
||||
|
@ -15,7 +15,7 @@ ${CLICKHOUSE_CLIENT} --query "INSERT INTO test_truncate.test_view_depend VALUES(
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test_truncate.test_view;"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT '========Execute Truncate========';"
|
||||
echo "`"${CLICKHOUSE_CLIENT}" --query "TRUNCATE TABLE test_truncate.test_view;" --server_logs_file=/dev/null 2>&1 | grep -c "Code: 48.*Truncate is not supported by storage View"`"
|
||||
echo "$("${CLICKHOUSE_CLIENT}" --query "TRUNCATE TABLE test_truncate.test_view;" --server_logs_file=/dev/null 2>&1 | grep -c "Code: 48.*Truncate is not supported by storage View")"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT '========After Truncate========';"
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test_truncate.test_view;"
|
||||
|
@ -14,7 +14,7 @@ function query_with_retry
|
||||
retry=0
|
||||
until [ $retry -ge 5 ]
|
||||
do
|
||||
result=`$CLICKHOUSE_CLIENT "$2" --query="$1" 2>&1`
|
||||
result=$($CLICKHOUSE_CLIENT "$2" --query="$1" 2>&1)
|
||||
if [ "$?" == 0 ]; then
|
||||
echo -n "$result"
|
||||
return
|
||||
|
@ -21,11 +21,11 @@ settings="$server_logs --log_queries=1 --log_query_threads=1 --log_profile_event
|
||||
# SELECT
|
||||
true > "$server_logs_file"
|
||||
$CLICKHOUSE_CLIENT "$settings" -q "SELECT 1 FROM system.one FORMAT Null"
|
||||
lines_one_server=`cat "$server_logs_file" | wc -l`
|
||||
lines_one_server=$(cat "$server_logs_file" | wc -l)
|
||||
|
||||
true > "$server_logs_file"
|
||||
$CLICKHOUSE_CLIENT "$settings" -q "SELECT 1 FROM remote('127.0.0.2,127.0.0.3', system, one) FORMAT Null"
|
||||
lines_two_servers=`cat "$server_logs_file" | wc -l`
|
||||
lines_two_servers=$(cat "$server_logs_file" | wc -l)
|
||||
|
||||
(( $lines_two_servers >= 2 * $lines_one_server )) || echo "Fail: $lines_two_servers $lines_one_server"
|
||||
|
||||
@ -35,11 +35,11 @@ $CLICKHOUSE_CLIENT "$settings" -q "CREATE TABLE null_00634_1 (i Int8) ENGINE = N
|
||||
|
||||
true > "$server_logs_file"
|
||||
$CLICKHOUSE_CLIENT "$settings" -q "INSERT INTO null_00634_1 VALUES (0)"
|
||||
lines_one_server=`cat "$server_logs_file" | wc -l`
|
||||
lines_one_server=$(cat "$server_logs_file" | wc -l)
|
||||
|
||||
true > "$server_logs_file"
|
||||
$CLICKHOUSE_CLIENT "$settings" -q "INSERT INTO TABLE FUNCTION remote('127.0.0.2', '${CLICKHOUSE_DATABASE}', 'null_00634_1') VALUES (0)"
|
||||
lines_two_servers=`cat "$server_logs_file" | wc -l`
|
||||
lines_two_servers=$(cat "$server_logs_file" | wc -l)
|
||||
|
||||
$CLICKHOUSE_CLIENT "$settings" -q "DROP TABLE IF EXISTS null_00634_1"
|
||||
(( $lines_two_servers > $lines_one_server )) || echo "Fail: $lines_two_servers $lines_one_server"
|
||||
|
@ -28,7 +28,7 @@ $CLICKHOUSE_CLIENT "$settings" -n -q "
|
||||
SELECT count() FROM null_00634;
|
||||
DROP TABLE null_00634;"
|
||||
|
||||
(( `cat "$server_logs_file" | wc -l` >= 110 )) || echo Fail
|
||||
(( $(cat "$server_logs_file" | wc -l) >= 110 )) || echo Fail
|
||||
|
||||
|
||||
# Check ProfileEvents in query_log
|
||||
|
@ -43,7 +43,7 @@ ${CLICKHOUSE_CLIENT} --query="INSERT INTO unsigned_integer_test_table VALUES (0)
|
||||
${CLICKHOUSE_CLIENT} --query="INSERT INTO enum_test_table VALUES ('hello'), ('world'), ('world'), ('yandex'), ('clickhouse'), ('clickhouse');"
|
||||
${CLICKHOUSE_CLIENT} --query="INSERT INTO date_test_table VALUES (1), (2), (2), (256), (257), (257);"
|
||||
|
||||
CLICKHOUSE_CLIENT=`echo "${CLICKHOUSE_CLIENT}" | sed 's/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/--send_logs_level=debug/g'`
|
||||
CLICKHOUSE_CLIENT=$(echo "${CLICKHOUSE_CLIENT}" | sed 's/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/--send_logs_level=debug/g')
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query="SELECT count() FROM string_test_table WHERE toUInt64(val) == 0;" 2>&1 |grep -q "3 marks to read from 1 ranges" && echo "no monotonic int case: String -> UInt64"
|
||||
${CLICKHOUSE_CLIENT} --query="SELECT count() FROM fixed_string_test_table WHERE toUInt64(val) == 0;" 2>&1 |grep -q "3 marks to read from 1 ranges" && echo "no monotonic int case: FixedString -> UInt64"
|
||||
@ -78,7 +78,7 @@ ${CLICKHOUSE_CLIENT} --query="SELECT count() FROM date_test_table WHERE toUInt16
|
||||
${CLICKHOUSE_CLIENT} --query="SELECT count() FROM date_test_table WHERE toInt8(val) == 1;" 2>&1 |grep -q "5 marks to read from" && echo "monotonic int case: Date -> Int8"
|
||||
${CLICKHOUSE_CLIENT} --query="SELECT count() FROM date_test_table WHERE toUInt8(val) == 1;" 2>&1 |grep -q "5 marks to read from" && echo "monotonic int case: Date -> UInt8"
|
||||
|
||||
CLICKHOUSE_CLIENT=`echo "${CLICKHOUSE_CLIENT}" | sed 's/--send_logs_level=debug/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/g'`
|
||||
CLICKHOUSE_CLIENT=$(echo "${CLICKHOUSE_CLIENT}" | sed 's/--send_logs_level=debug/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/g')
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS string_test_table;"
|
||||
${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS fixed_string_test_table;"
|
||||
|
@ -22,7 +22,7 @@ ${CLICKHOUSE_CLIENT} --query "SELECT TOP 2 * FROM test_00687 ORDER BY val;"
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT TOP (2) * FROM test_00687 ORDER BY val;"
|
||||
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test_00687 ORDER BY val LIMIT 2 OFFSET 2;"
|
||||
|
||||
echo "`"${CLICKHOUSE_CLIENT}" --query "SELECT TOP 2 * FROM test_00687 ORDER BY val LIMIT 2;" 2>&1 | grep -c "Code: 406"`"
|
||||
echo "`"${CLICKHOUSE_CLIENT}" --query "SELECT * FROM test_00687 ORDER BY val LIMIT 2,3 OFFSET 2;" 2>&1 | grep -c "Code: 62"`"
|
||||
echo "$("${CLICKHOUSE_CLIENT}" --query "SELECT TOP 2 * FROM test_00687 ORDER BY val LIMIT 2;" 2>&1 | grep -c "Code: 406")"
|
||||
echo "$("${CLICKHOUSE_CLIENT}" --query "SELECT * FROM test_00687 ORDER BY val LIMIT 2,3 OFFSET 2;" 2>&1 | grep -c "Code: 62")"
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "DROP TABLE test_00687;"
|
||||
|
@ -14,7 +14,7 @@ $CLICKHOUSE_CLIENT -q "select name from system.table_functions format TSV;" > "$
|
||||
|
||||
for SQL_FUZZY_RUN in $(seq "${SQL_FUZZY_RUNS:=10}"); do
|
||||
env SQL_FUZZY_RUN="$SQL_FUZZY_RUN" "$CURDIR"/00746_sql_fuzzy.pl | $CLICKHOUSE_CLIENT --format Null --max_execution_time 10 -n --ignore-error >/dev/null 2>&1
|
||||
if [[ `$CLICKHOUSE_CLIENT -q "SELECT 'Still alive'"` != 'Still alive' ]]; then
|
||||
if [[ $($CLICKHOUSE_CLIENT -q "SELECT 'Still alive'") != 'Still alive' ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
@ -19,7 +19,7 @@ function thread2()
|
||||
{
|
||||
while true; do
|
||||
echo "ALTER TABLE concurrent_alter_column ADD COLUMN d DOUBLE" | ${CLICKHOUSE_CLIENT} --query_id=alter2;
|
||||
sleep "`echo 0.0$RANDOM`";
|
||||
sleep "$(echo 0.0$RANDOM)";
|
||||
echo "ALTER TABLE concurrent_alter_column DROP COLUMN d" | ${CLICKHOUSE_CLIENT} --query_id=alter2;
|
||||
done
|
||||
}
|
||||
@ -28,7 +28,7 @@ function thread3()
|
||||
{
|
||||
while true; do
|
||||
echo "ALTER TABLE concurrent_alter_column ADD COLUMN e DOUBLE" | ${CLICKHOUSE_CLIENT} --query_id=alter3;
|
||||
sleep "`echo 0.0$RANDOM`";
|
||||
sleep "$(echo 0.0$RANDOM)";
|
||||
echo "ALTER TABLE concurrent_alter_column DROP COLUMN e" | ${CLICKHOUSE_CLIENT} --query_id=alter3;
|
||||
done
|
||||
}
|
||||
@ -37,7 +37,7 @@ function thread4()
|
||||
{
|
||||
while true; do
|
||||
echo "ALTER TABLE concurrent_alter_column ADD COLUMN f DOUBLE" | ${CLICKHOUSE_CLIENT} --query_id=alter4;
|
||||
sleep "`echo 0.0$RANDOM`";
|
||||
sleep "$(echo 0.0$RANDOM)";
|
||||
echo "ALTER TABLE concurrent_alter_column DROP COLUMN f" | ${CLICKHOUSE_CLIENT} --query_id=alter4;
|
||||
done
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
OUTPUT=`$CLICKHOUSE_CLIENT_BINARY -c 1 -C 2 2>&1`
|
||||
OUTPUT=$($CLICKHOUSE_CLIENT_BINARY -c 1 -C 2 2>&1)
|
||||
|
||||
#test will fail if clickouse-client exit code is 0
|
||||
if [ $? -eq 0 ]; then
|
||||
|
@ -19,11 +19,11 @@ ${CLICKHOUSE_CLIENT} --query="ALTER TABLE test.kill_mutation DELETE WHERE toUInt
|
||||
|
||||
check_query1="SELECT count() FROM system.mutations WHERE database = 'test' AND table = 'kill_mutation' AND is_done = 0"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query1" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query1" 2>&1)
|
||||
|
||||
while [ "$query_result" == "0" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query1" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query1" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
@ -45,11 +45,11 @@ ${CLICKHOUSE_CLIENT} --query="ALTER TABLE test.kill_mutation DELETE WHERE x = 1
|
||||
|
||||
check_query2="SELECT count() FROM system.mutations WHERE database = 'test' AND table = 'kill_mutation' AND mutation_id = 'mutation_4.txt'"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query2" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query2" 2>&1)
|
||||
|
||||
while [ "$query_result" == "0" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query2" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query2" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
|
@ -22,11 +22,11 @@ ${CLICKHOUSE_CLIENT} --query="ALTER TABLE test.kill_mutation_r1 DELETE WHERE toU
|
||||
|
||||
check_query1="SELECT count() FROM system.mutations WHERE database = 'test' AND table = 'kill_mutation_r1' AND is_done = 0"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query1" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query1" 2>&1)
|
||||
|
||||
while [ "$query_result" == "0" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query1" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query1" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
@ -53,11 +53,11 @@ ${CLICKHOUSE_CLIENT} --query="ALTER TABLE test.kill_mutation_r1 DELETE WHERE toU
|
||||
|
||||
check_query1="SELECT count() FROM system.mutations WHERE database = 'test' AND table = 'kill_mutation_r1' AND is_done = 0"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query1" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query1" 2>&1)
|
||||
|
||||
while [ "$query_result" == "0" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query1" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query1" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
@ -66,11 +66,11 @@ ${CLICKHOUSE_CLIENT} --query="ALTER TABLE test.kill_mutation_r1 DELETE WHERE x =
|
||||
|
||||
check_query2="SELECT count() FROM system.mutations WHERE database = 'test' AND table = 'kill_mutation_r1' AND mutation_id = '0000000001' AND is_done = 0"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query2" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query2" 2>&1)
|
||||
|
||||
while [ "$query_result" == "0" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query2" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query2" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
|
@ -31,7 +31,7 @@ DATA_DIR=$CUR_DIR/data_parquet
|
||||
# BUG! nulls.snappy.parquet - parquet-reader shows wrong structure. Actual structure is {"type":"struct","fields":[{"name":"b_struct","type":{"type":"struct","fields":[{"name":"b_c_int","type":"integer","nullable":true,"metadata":{}}]},"nullable":true,"metadata":{}}]}
|
||||
# why? repeated_no_annotation.parquet
|
||||
|
||||
for NAME in `find "$DATA_DIR"/*.parquet -print0 | xargs -0 -n 1 basename | sort`; do
|
||||
for NAME in $(find "$DATA_DIR"/*.parquet -print0 | xargs -0 -n 1 basename | sort); do
|
||||
echo === Try load data from "$NAME"
|
||||
|
||||
JSON=$DATA_DIR/$NAME.json
|
||||
@ -45,7 +45,7 @@ for NAME in `find "$DATA_DIR"/*.parquet -print0 | xargs -0 -n 1 basename | sort`
|
||||
# [ -n "$BUILD_DIR" ] && $BUILD_DIR/contrib/arrow-cmake/parquet-reader $DATA_DIR/$NAME > $DATA_DIR/$NAME.dump
|
||||
|
||||
#COLUMNS=`$CUR_DIR/00900_parquet_create_table_columns.pl $JSON` 2>&1 || continue
|
||||
COLUMNS=`cat "$COLUMNS_FILE"` || continue
|
||||
COLUMNS=$(cat "$COLUMNS_FILE") || continue
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS parquet_load"
|
||||
${CLICKHOUSE_CLIENT} --query="CREATE TABLE parquet_load ($COLUMNS) ENGINE = Memory"
|
||||
|
@ -6,6 +6,6 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
echo 'DROP TABLE IF EXISTS table_for_insert' | ${CLICKHOUSE_CURL} -sSg "${CLICKHOUSE_URL}" -d @-
|
||||
echo 'CREATE TABLE table_for_insert (a UInt8, b UInt8) ENGINE = Memory' | ${CLICKHOUSE_CURL} -sSg "${CLICKHOUSE_URL}" -d @-
|
||||
echo "INSERT INTO table_for_insert VALUES `printf '%*s' "1000000" "" | sed 's/ /(1, 2)/g'`" | ${CLICKHOUSE_CURL_COMMAND} -q --max-time 30 -sSg "${CLICKHOUSE_URL}" -d @-
|
||||
echo "INSERT INTO table_for_insert VALUES $(printf '%*s' "1000000" "" | sed 's/ /(1, 2)/g')" | ${CLICKHOUSE_CURL_COMMAND} -q --max-time 30 -sSg "${CLICKHOUSE_URL}" -d @-
|
||||
echo 'SELECT count(*) FROM table_for_insert' | ${CLICKHOUSE_CURL} -sSg "${CLICKHOUSE_URL}" -d @-
|
||||
echo 'DROP TABLE IF EXISTS table_for_insert' | ${CLICKHOUSE_CURL} -sSg "${CLICKHOUSE_URL}" -d @-
|
||||
|
@ -40,8 +40,8 @@ timeout 20 "$CLICKHOUSE_CLIENT" -q "KILL QUERY WHERE query='$query_for_pending'
|
||||
for _ in {1..15}
|
||||
do
|
||||
sleep 1
|
||||
no_first_query=`$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query='$query_for_pending'"`
|
||||
no_second_query=`$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query='$query_to_kill'"`
|
||||
no_first_query=$($CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query='$query_for_pending'")
|
||||
no_second_query=$($CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query='$query_to_kill'")
|
||||
if [ "$no_first_query" == "0" ] && [ "$no_second_query" == "0" ]; then
|
||||
echo "killed"
|
||||
break
|
||||
|
@ -6,7 +6,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
set -e
|
||||
|
||||
for sequence in 1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000; do \
|
||||
rate=`echo "1 $sequence" | awk '{printf("%0.9f\n",$1/$2)}'`
|
||||
rate=$(echo "1 $sequence" | awk '{printf("%0.9f\n",$1/$2)}')
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS test.bloom_filter_idx";
|
||||
$CLICKHOUSE_CLIENT --query="CREATE TABLE test.bloom_filter_idx ( u64 UInt64, i32 Int32, f64 Float64, d Decimal(10, 2), s String, e Enum8('a' = 1, 'b' = 2, 'c' = 3), dt Date, INDEX bloom_filter_a i32 TYPE bloom_filter($rate) GRANULARITY 1 ) ENGINE = MergeTree() ORDER BY u64 SETTINGS index_granularity = 8192"
|
||||
done
|
||||
|
@ -27,35 +27,35 @@ $CLICKHOUSE_CLIENT --query="INSERT INTO elog VALUES (toDate('2018-10-01'), 3, 'h
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count(*) from elog" # 3 rows
|
||||
|
||||
count=`$CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'"`
|
||||
count=$($CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'")
|
||||
|
||||
while [[ $count != 2 ]]
|
||||
do
|
||||
sleep 1
|
||||
count=`$CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'"`
|
||||
count=$($CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'")
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO elog VALUES (toDate('2018-10-01'), 1, 'hello')"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count(*) from elog" # 4 rows
|
||||
count=`$CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'"`
|
||||
count=$($CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'")
|
||||
|
||||
while [[ $count != 2 ]]
|
||||
do
|
||||
sleep 1
|
||||
count=`$CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'"`
|
||||
count=$($CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'")
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO elog VALUES (toDate('2018-10-01'), 2, 'hello')"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count(*) from elog" # 5 rows
|
||||
|
||||
count=`$CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'"`
|
||||
count=$($CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'")
|
||||
|
||||
while [[ $count != 2 ]]
|
||||
do
|
||||
sleep 1
|
||||
count=`$CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'"`
|
||||
count=$($CLICKHOUSE_CLIENT --query="SELECT COUNT(*) FROM system.zookeeper where path = '/clickhouse/tables/elog/blocks'")
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="INSERT INTO elog VALUES (toDate('2018-10-01'), 2, 'hello')"
|
||||
|
@ -3,7 +3,7 @@
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
CLICKHOUSE_CLIENT=`echo "${CLICKHOUSE_CLIENT}" | sed 's/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/--send_logs_level=none/g'`
|
||||
CLICKHOUSE_CLIENT=$(echo "${CLICKHOUSE_CLIENT}" | sed 's/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/--send_logs_level=none/g')
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS check;"
|
||||
|
||||
|
@ -28,7 +28,7 @@ ${CLICKHOUSE_CLIENT} --query="ALTER TABLE table_with_empty_part DELETE WHERE id
|
||||
|
||||
sleep 0.5
|
||||
|
||||
mutation_id=`${CLICKHOUSE_CLIENT} --query="SELECT max(mutation_id) FROM system.mutations WHERE table='table_with_empty_part'"`
|
||||
mutation_id=$(${CLICKHOUSE_CLIENT} --query="SELECT max(mutation_id) FROM system.mutations WHERE table='table_with_empty_part'")
|
||||
|
||||
wait_for_mutation "table_with_empty_part" "$mutation_id"
|
||||
|
||||
|
@ -35,7 +35,7 @@ function alter_thread()
|
||||
|
||||
while true; do
|
||||
$CLICKHOUSE_CLIENT --allow_experimental_alter_materialized_view_structure=1 -q "${ALTERS[$RANDOM % 2]}"
|
||||
sleep "`echo 0.$RANDOM`";
|
||||
sleep "$(echo 0.$RANDOM)";
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
CLICKHOUSE_CLIENT=`echo "${CLICKHOUSE_CLIENT}" | sed 's/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/--send_logs_level=none/g'`
|
||||
CLICKHOUSE_CLIENT=$(echo "${CLICKHOUSE_CLIENT}" | sed 's/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/--send_logs_level=none/g')
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="SELECT * FROM (SELECT number % 5 AS a, count() AS b, c FROM numbers(10) ARRAY JOIN [1,2] AS c GROUP BY a,c) AS table ORDER BY a LIMIT 3 WITH TIES BY a" 2>&1 | grep -q "Code: 498." && echo 'OK' || echo 'FAIL' ||:
|
||||
|
||||
|
@ -10,7 +10,7 @@ function query_with_retry
|
||||
retry=0
|
||||
until [ $retry -ge 5 ]
|
||||
do
|
||||
result=`$CLICKHOUSE_CLIENT "$2" --query="$1" 2>&1`
|
||||
result=$($CLICKHOUSE_CLIENT "$2" --query="$1" 2>&1)
|
||||
if [ "$?" == 0 ]; then
|
||||
echo -n "$result"
|
||||
return
|
||||
|
@ -7,5 +7,5 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
${CLICKHOUSE_CLIENT} --query="SELECT avgWeighted(x, weight) FROM (SELECT t.1 AS x, t.2 AS weight FROM (SELECT arrayJoin([(1, 5), (2, 4), (3, 3), (4, 2), (5, 1)]) AS t));"
|
||||
${CLICKHOUSE_CLIENT} --query="SELECT avgWeighted(x, weight) FROM (SELECT t.1 AS x, t.2 AS weight FROM (SELECT arrayJoin([(1, 0), (2, 0), (3, 0), (4, 0), (5, 0)]) AS t));"
|
||||
|
||||
echo "`"${CLICKHOUSE_CLIENT}" --server_logs_file=/dev/null --query="SELECT avgWeighted(toDecimal64(0, 0), toFloat64(0))" 2>&1`" \
|
||||
echo "$("${CLICKHOUSE_CLIENT}" --server_logs_file=/dev/null --query="SELECT avgWeighted(toDecimal64(0, 0), toFloat64(0))" 2>&1)" \
|
||||
| grep -c 'Code: 43. DB::Exception: .* DB::Exception:.* Different types .* of arguments for aggregate function avgWeighted'
|
||||
|
@ -40,11 +40,11 @@ $CLICKHOUSE_CLIENT --query "INSERT INTO database_for_dict.table_for_dict VALUES
|
||||
function check()
|
||||
{
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('database_for_dict.dict_with_zero_min_lifetime', 'value', toUInt64(2))"`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('database_for_dict.dict_with_zero_min_lifetime', 'value', toUInt64(2))")
|
||||
|
||||
while [ "$query_result" != "2.2" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('database_for_dict.dict_with_zero_min_lifetime', 'value', toUInt64(2))"`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT dictGetFloat64('database_for_dict.dict_with_zero_min_lifetime', 'value', toUInt64(2))")
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -41,11 +41,11 @@ $CLICKHOUSE_CLIENT --query "DROP TABLE dictdb.dict_invalidate"
|
||||
function check_exception_detected()
|
||||
{
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb' AND name = 'invalidate'" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb' AND name = 'invalidate'" 2>&1)
|
||||
|
||||
while [ -z "$query_result" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb' AND name = 'invalidate'" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb' AND name = 'invalidate'" 2>&1)
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
@ -66,11 +66,11 @@ FROM system.one"
|
||||
|
||||
function check_exception_fixed()
|
||||
{
|
||||
query_result=`$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb' AND name = 'invalidate'" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb' AND name = 'invalidate'" 2>&1)
|
||||
|
||||
while [ "$query_result" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb' AND name = 'invalidate'" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query "SELECT last_exception FROM system.dictionaries WHERE database = 'dictdb' AND name = 'invalidate'" 2>&1)
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ $CLICKHOUSE_CLIENT -q "SELECT a FROM m ORDER BY a LIMIT 5"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT a, s FROM m ORDER BY a, s LIMIT 10"
|
||||
|
||||
# Not a single .sql test with max_rows_to_read because it doesn't work with Merge storage
|
||||
rows_read=`$CLICKHOUSE_CLIENT -q "SELECT a FROM m ORDER BY a LIMIT 10 FORMAT JSON" --max_threads=1 --max_block_size=20 | grep "rows_read" | sed 's/[^0-9]*//g'`
|
||||
rows_read=$($CLICKHOUSE_CLIENT -q "SELECT a FROM m ORDER BY a LIMIT 10 FORMAT JSON" --max_threads=1 --max_block_size=20 | grep "rows_read" | sed 's/[^0-9]*//g')
|
||||
|
||||
# Expected number of read rows with a bit margin
|
||||
if [[ $rows_read -lt 500 ]]
|
||||
@ -35,7 +35,7 @@ fi
|
||||
$CLICKHOUSE_CLIENT -q "SELECT '---StorageBuffer---'"
|
||||
$CLICKHOUSE_CLIENT -q "CREATE TABLE buf (a UInt32, s String) engine = Buffer(currentDatabase(), s2, 16, 10, 100, 10000, 1000000, 10000000, 100000000)"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT a, s FROM buf ORDER BY a, s LIMIT 10"
|
||||
rows_read=`$CLICKHOUSE_CLIENT -q "SELECT a FROM buf ORDER BY a LIMIT 10 FORMAT JSON" --max_threads=1 --max_block_size=20 | grep "rows_read" | sed 's/[^0-9]*//g'`
|
||||
rows_read=$($CLICKHOUSE_CLIENT -q "SELECT a FROM buf ORDER BY a LIMIT 10 FORMAT JSON" --max_threads=1 --max_block_size=20 | grep "rows_read" | sed 's/[^0-9]*//g')
|
||||
|
||||
# Expected number of read rows with a bit margin
|
||||
if [[ $rows_read -lt 500 ]]
|
||||
@ -47,7 +47,7 @@ fi
|
||||
$CLICKHOUSE_CLIENT -q "SELECT '---MaterializedView---'"
|
||||
$CLICKHOUSE_CLIENT -q "CREATE MATERIALIZED VIEW mv (a UInt32, s String) engine = MergeTree ORDER BY s POPULATE AS SELECT a, s FROM s1 WHERE a % 7 = 0"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT a, s FROM mv ORDER BY s LIMIT 10"
|
||||
rows_read=`$CLICKHOUSE_CLIENT -q "SELECT a, s FROM mv ORDER BY s LIMIT 10 FORMAT JSON" --max_threads=1 --max_block_size=20 | grep "rows_read" | sed 's/[^0-9]*//g'`
|
||||
rows_read=$($CLICKHOUSE_CLIENT -q "SELECT a, s FROM mv ORDER BY s LIMIT 10 FORMAT JSON" --max_threads=1 --max_block_size=20 | grep "rows_read" | sed 's/[^0-9]*//g')
|
||||
|
||||
if [[ $rows_read -lt 500 ]]
|
||||
then echo "OK"
|
||||
|
@ -7,11 +7,11 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
function wait_mutation_to_start()
|
||||
{
|
||||
query_wait=`$CLICKHOUSE_CLIENT --query="SELECT length(parts_to_do_names) FROM system.mutations where table = '$1'" 2>&1`
|
||||
query_wait=$($CLICKHOUSE_CLIENT --query="SELECT length(parts_to_do_names) FROM system.mutations where table = '$1'" 2>&1)
|
||||
|
||||
while [ "$query_wait" == "0" ] || [ -z "$query_wait" ]
|
||||
do
|
||||
query_wait=`$CLICKHOUSE_CLIENT --query="SELECT length(parts_to_do_names) FROM system.mutations where table = '$1'" 2>&1`
|
||||
query_wait=$($CLICKHOUSE_CLIENT --query="SELECT length(parts_to_do_names) FROM system.mutations where table = '$1'" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
}
|
||||
|
@ -3,6 +3,6 @@
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
if [[ `${CLICKHOUSE_CURL_COMMAND} -q -I "${CLICKHOUSE_URL}&query=BADREQUEST" 2>&1 | grep -c 'X-ClickHouse-Exception-Code: 62'` -eq 1 ]]; then
|
||||
if [[ $(${CLICKHOUSE_CURL_COMMAND} -q -I "${CLICKHOUSE_URL}&query=BADREQUEST" 2>&1 | grep -c 'X-ClickHouse-Exception-Code: 62') -eq 1 ]]; then
|
||||
echo "True"
|
||||
fi
|
||||
|
@ -14,26 +14,26 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
REPLICAS=5
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS concurrent_mutate_mt_$i"
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "CREATE TABLE concurrent_mutate_mt_$i (key UInt64, value1 UInt64, value2 String) ENGINE = ReplicatedMergeTree('/clickhouse/tables/concurrent_mutate_mt', '$i') ORDER BY key SETTINGS max_replicated_mutations_in_queue=1000, number_of_free_entries_in_pool_to_execute_mutation=0,max_replicated_merges_in_queue=1000,temporary_directories_lifetime=10,cleanup_delay_period=3,cleanup_delay_period_random_add=0"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO concurrent_mutate_mt_1 SELECT number, number + 10, toString(number) from numbers(10)"
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO concurrent_mutate_mt_1 SELECT number, number + 10, toString(number) from numbers(10, 40)"
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM SYNC REPLICA concurrent_mutate_mt_$i"
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_mutate_mt_$i"
|
||||
done
|
||||
|
||||
INITIAL_SUM=`$CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_mutate_mt_1"`
|
||||
INITIAL_SUM=$($CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_mutate_mt_1")
|
||||
|
||||
# Run mutation on random replica
|
||||
function correct_alter_thread()
|
||||
@ -96,7 +96,7 @@ wait
|
||||
|
||||
echo "Finishing alters"
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "ATTACH TABLE concurrent_mutate_mt_$i" 2> /dev/null
|
||||
done
|
||||
|
||||
@ -110,13 +110,13 @@ while [[ $($CLICKHOUSE_CLIENT --query "select * from system.mutations where tabl
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "ATTACH TABLE concurrent_mutate_mt_$i" 2> /dev/null
|
||||
done
|
||||
counter=$(($counter + 1))
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SELECT SUM(toUInt64(value1)) > $INITIAL_SUM FROM concurrent_mutate_mt_$i"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT COUNT() FROM system.mutations WHERE table='concurrent_mutate_mt_$i' and is_done=0" # all mutations have to be done
|
||||
$CLICKHOUSE_CLIENT --query "SELECT * FROM system.mutations WHERE table='concurrent_mutate_mt_$i' and is_done=0" # for verbose output
|
||||
|
@ -5,18 +5,18 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
REPLICAS=3
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS concurrent_alter_add_drop_$i"
|
||||
done
|
||||
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "CREATE TABLE concurrent_alter_add_drop_$i (key UInt64, value0 UInt8) ENGINE = ReplicatedMergeTree('/clickhouse/tables/concurrent_alter_add_drop_column', '$i') ORDER BY key SETTINGS max_replicated_mutations_in_queue=1000, number_of_free_entries_in_pool_to_execute_mutation=0,max_replicated_merges_in_queue=1000"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO concurrent_alter_add_drop_1 SELECT number, number + 10 from numbers(100000)"
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM SYNC REPLICA concurrent_alter_add_drop_$i"
|
||||
done
|
||||
|
||||
@ -100,7 +100,7 @@ while [[ $(timeout 120 "$CLICKHOUSE_CLIENT" --query "ALTER TABLE concurrent_alte
|
||||
sleep 1
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM SYNC REPLICA concurrent_alter_add_drop_$i"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT COUNT() FROM system.mutations WHERE is_done = 0 and table = 'concurrent_alter_add_drop_$i'"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT * FROM system.mutations WHERE is_done = 0 and table = 'concurrent_alter_add_drop_$i'"
|
||||
|
@ -5,22 +5,22 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
REPLICAS=3
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS concurrent_alter_detach_$i"
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "CREATE TABLE concurrent_alter_detach_$i (key UInt64, value1 UInt8, value2 UInt8) ENGINE = ReplicatedMergeTree('/clickhouse/tables/concurrent_alter_detach', '$i') ORDER BY key SETTINGS max_replicated_mutations_in_queue=1000, number_of_free_entries_in_pool_to_execute_mutation=0,max_replicated_merges_in_queue=1000,temporary_directories_lifetime=10,cleanup_delay_period=3,cleanup_delay_period_random_add=0"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO concurrent_alter_detach_1 SELECT number, number + 10, number from numbers(10)"
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO concurrent_alter_detach_1 SELECT number, number + 10, number from numbers(10, 40)"
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_alter_detach_$i"
|
||||
done
|
||||
|
||||
INITIAL_SUM=`$CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_alter_detach_1"`
|
||||
INITIAL_SUM=$($CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_alter_detach_1")
|
||||
|
||||
# This alters mostly requires not only metadata change
|
||||
# but also conversion of data. Also they are all compatible
|
||||
@ -85,7 +85,7 @@ echo "Finishing alters"
|
||||
|
||||
sleep 1
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "ATTACH TABLE concurrent_alter_detach_$i" 2> /dev/null
|
||||
done
|
||||
|
||||
@ -93,12 +93,12 @@ done
|
||||
while [[ $(timeout 120 "$CLICKHOUSE_CLIENT" --query "ALTER TABLE concurrent_alter_detach_1 MODIFY COLUMN value1 String SETTINGS replication_alter_partitions_sync=2" 2>&1) ]]; do
|
||||
sleep 1
|
||||
# just try to attach table if it failed for some reason in the code above
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "ATTACH TABLE concurrent_alter_detach_$i" 2> /dev/null
|
||||
done
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM SYNC REPLICA concurrent_alter_detach_$i"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT SUM(toUInt64(value1)) > $INITIAL_SUM FROM concurrent_alter_detach_$i"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT COUNT() FROM system.mutations WHERE is_done=0 and table = 'concurrent_alter_detach_$i'" # all mutations have to be done
|
||||
|
@ -5,26 +5,26 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
REPLICAS=5
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS concurrent_alter_mt_$i"
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "CREATE TABLE concurrent_alter_mt_$i (key UInt64, value1 UInt64, value2 Int32) ENGINE = ReplicatedMergeTree('/clickhouse/tables/concurrent_alter_mt', '$i') ORDER BY key SETTINGS max_replicated_mutations_in_queue=1000, number_of_free_entries_in_pool_to_execute_mutation=0,max_replicated_merges_in_queue=1000"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO concurrent_alter_mt_1 SELECT number, number + 10, number from numbers(10)"
|
||||
$CLICKHOUSE_CLIENT --query "INSERT INTO concurrent_alter_mt_1 SELECT number, number + 10, number from numbers(10, 40)"
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM SYNC REPLICA concurrent_alter_mt_$i"
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_alter_mt_$i"
|
||||
done
|
||||
|
||||
INITIAL_SUM=`$CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_alter_mt_1"`
|
||||
INITIAL_SUM=$($CLICKHOUSE_CLIENT --query "SELECT SUM(value1) FROM concurrent_alter_mt_1")
|
||||
|
||||
# This alters mostly requires not only metadata change
|
||||
# but also conversion of data. Also they are all compatible
|
||||
@ -111,7 +111,7 @@ while [[ $(timeout 120 "$CLICKHOUSE_CLIENT" --query "ALTER TABLE concurrent_alte
|
||||
sleep 1
|
||||
done
|
||||
|
||||
for i in `seq $REPLICAS`; do
|
||||
for i in $(seq $REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT --query "SYSTEM SYNC REPLICA concurrent_alter_mt_$i"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT SUM(toUInt64(value1)) > $INITIAL_SUM FROM concurrent_alter_mt_$i"
|
||||
$CLICKHOUSE_CLIENT --query "SELECT COUNT() FROM system.mutations WHERE is_done=0 and table = 'concurrent_alter_mt_$i'" # all mutations have to be done
|
||||
|
@ -9,7 +9,7 @@ url="${url_without_session}session_id=test_01098"
|
||||
${CLICKHOUSE_CURL} -m 30 -sSk "$url" --data "CREATE TEMPORARY TABLE tmp_table AS SELECT number AS n FROM numbers(42)" > /dev/null;
|
||||
|
||||
name_expr="'\`' || database || '\`.\`' || name || '\`'"
|
||||
full_tmp_name=`echo "SELECT $name_expr FROM system.tables WHERE database='_temporary_and_external_tables' AND create_table_query LIKE '%tmp_table%'" | ${CLICKHOUSE_CURL} -m 30 -sSgk "$url" -d @-`
|
||||
full_tmp_name=$(echo "SELECT $name_expr FROM system.tables WHERE database='_temporary_and_external_tables' AND create_table_query LIKE '%tmp_table%'" | ${CLICKHOUSE_CURL} -m 30 -sSgk "$url" -d @-)
|
||||
|
||||
echo "SELECT * FROM $full_tmp_name" | ${CLICKHOUSE_CURL} -m 60 -sSgk "$url" -d @- | grep -F "Code: 291" > /dev/null && echo "OK"
|
||||
|
||||
@ -17,7 +17,7 @@ echo -ne '0\n1\n' | ${CLICKHOUSE_CURL} -m 30 -sSkF 'file=@-' "$url&file_format=C
|
||||
|
||||
echo -ne '0\n1\n' | ${CLICKHOUSE_CURL} -m 30 -sSkF 'file=@-' "$url&file_format=CSV&file_types=UInt64&query=SELECT+sleepEachRow(3)+FROM+file" > /dev/null &
|
||||
sleep 1
|
||||
full_tmp_names=`echo "SELECT $name_expr FROM system.tables WHERE database='_temporary_and_external_tables' FORMAT TSV" | ${CLICKHOUSE_CURL} -m 30 -sSgk "$url_without_session" -d @-`
|
||||
full_tmp_names=$(echo "SELECT $name_expr FROM system.tables WHERE database='_temporary_and_external_tables' FORMAT TSV" | ${CLICKHOUSE_CURL} -m 30 -sSgk "$url_without_session" -d @-)
|
||||
for name in $full_tmp_names
|
||||
do
|
||||
${CLICKHOUSE_CURL} -m 30 -sSk "${url_without_session}query=SHOW+CREATE+TABLE+$name" 1>/dev/null 2>/dev/null
|
||||
|
@ -3,7 +3,7 @@
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
for i in `seq 4`; do
|
||||
for i in $(seq 4); do
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS replica_01108_$i"
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS replica_01108_${i}_tmp"
|
||||
$CLICKHOUSE_CLIENT -q "CREATE TABLE replica_01108_$i (n int) ENGINE=ReplicatedMergeTree('/clickhouse/tables/replica_01108_$i', 'replica') ORDER BY tuple()"
|
||||
@ -62,12 +62,12 @@ timeout $TIMEOUT bash -c restart_thread_2 2> /dev/null &
|
||||
|
||||
wait
|
||||
|
||||
for i in `seq 4`; do
|
||||
for i in $(seq 4); do
|
||||
$CLICKHOUSE_CLIENT -q "SYSTEM SYNC REPLICA replica_01108_$i" >/dev/null 2>&1
|
||||
$CLICKHOUSE_CLIENT -q "SYSTEM SYNC REPLICA replica_01108_${i}_tmp" >/dev/null 2>&1
|
||||
done
|
||||
|
||||
while [[ `$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes WHERE query LIKE 'RENAME%'"` -gt 0 ]]; do
|
||||
while [[ $($CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes WHERE query LIKE 'RENAME%'") -gt 0 ]]; do
|
||||
sleep 1
|
||||
done;
|
||||
|
||||
@ -75,7 +75,7 @@ $CLICKHOUSE_CLIENT -q "SELECT replaceOne(name, '_tmp', '') FROM system.tables WH
|
||||
$CLICKHOUSE_CLIENT -q "SELECT sum(n), count(n) FROM merge(currentDatabase(), '^replica_01108_') GROUP BY position(_table, 'tmp')"
|
||||
|
||||
|
||||
for i in `seq 4`; do
|
||||
for i in $(seq 4); do
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS replica_01108_$i NO DELAY"
|
||||
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS replica_01108_${i}_tmp NO DELAY"
|
||||
done
|
||||
|
@ -46,7 +46,7 @@ $CLICKHOUSE_CLIENT -q "EXCHANGE TABLES test_01114_1.mt AND test_01114_2.mt"
|
||||
|
||||
# Check that nothing changed
|
||||
$CLICKHOUSE_CLIENT -q "SELECT count() FROM test_01114_1.mt"
|
||||
uuid_mt1=`$CLICKHOUSE_CLIENT -q "SELECT uuid FROM system.tables WHERE database='test_01114_1' AND name='mt'"`
|
||||
uuid_mt1=$($CLICKHOUSE_CLIENT -q "SELECT uuid FROM system.tables WHERE database='test_01114_1' AND name='mt'")
|
||||
$CLICKHOUSE_CLIENT --show_table_uuid_in_table_create_query_if_not_nil=1 -q "SHOW CREATE TABLE test_01114_1.mt" | sed "s/$uuid_mt1/00001114-0000-4000-8000-000000000001/g"
|
||||
$CLICKHOUSE_CLIENT --show_table_uuid_in_table_create_query_if_not_nil=1 -q "SHOW CREATE TABLE test_01114_2.mt"
|
||||
|
||||
|
@ -19,7 +19,7 @@ threads=10
|
||||
count_multiplier=1
|
||||
max_time_ms=1000
|
||||
|
||||
debug_or_sanitizer_build=`$CLICKHOUSE_CLIENT -q "WITH ((SELECT value FROM system.build_options WHERE name='BUILD_TYPE') AS build, (SELECT value FROM system.build_options WHERE name='CXX_FLAGS') as flags) SELECT build='Debug' OR flags LIKE '%fsanitize%' OR hasThreadFuzzer()"`
|
||||
debug_or_sanitizer_build=$($CLICKHOUSE_CLIENT -q "WITH ((SELECT value FROM system.build_options WHERE name='BUILD_TYPE') AS build, (SELECT value FROM system.build_options WHERE name='CXX_FLAGS') as flags) SELECT build='Debug' OR flags LIKE '%fsanitize%' OR hasThreadFuzzer()")
|
||||
|
||||
if [[ debug_or_sanitizer_build -eq 1 ]]; then tables=100; count_multiplier=10; max_time_ms=1500; fi
|
||||
|
||||
@ -41,12 +41,12 @@ wait
|
||||
$CLICKHOUSE_CLIENT -q "CREATE TABLE $db.table_merge (i UInt64, d Date, s String, n Nested(i UInt8, f Float32)) ENGINE=Merge('$db', '^table_')"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT count() * $count_multiplier, i, d, s, n.i, n.f FROM $db.table_merge GROUP BY i, d, s, n.i, n.f ORDER BY i"
|
||||
|
||||
db_engine=`$CLICKHOUSE_CLIENT -q "SELECT engine FROM system.databases WHERE name='$db'"`
|
||||
db_engine=$($CLICKHOUSE_CLIENT -q "SELECT engine FROM system.databases WHERE name='$db'")
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "DETACH DATABASE $db"
|
||||
|
||||
# get real time, grep seconds, remove point, remove leading zeros
|
||||
elapsed_ms=`{ time $CLICKHOUSE_CLIENT -q "ATTACH DATABASE $db ENGINE=$db_engine"; } 2>&1 | grep real | grep -Po "0m\K[0-9\.]*" | tr -d '.' | sed "s/^0*//"`
|
||||
elapsed_ms=$({ time $CLICKHOUSE_CLIENT -q "ATTACH DATABASE $db ENGINE=$db_engine"; } 2>&1 | grep real | grep -Po "0m\K[0-9\.]*" | tr -d '.' | sed "s/^0*//")
|
||||
$CLICKHOUSE_CLIENT -q "SELECT '01193_metadata_loading', $elapsed_ms FORMAT Null" # it will be printed to server log
|
||||
|
||||
if [[ $elapsed_ms -le $max_time_ms ]]; then echo ok; fi
|
||||
|
@ -36,11 +36,11 @@ $CLICKHOUSE_CLIENT --query "ALTER TABLE mutation_table MODIFY COLUMN value UInt3
|
||||
#### just check that both mutations started
|
||||
check_query="SELECT count() FROM system.mutations WHERE table='mutation_table' and database='$CLICKHOUSE_DATABASE'"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
|
||||
while [ "$query_result" != "2" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
@ -50,7 +50,7 @@ $CLICKHOUSE_CLIENT --query "KILL MUTATION WHERE mutation_id='$first_mutation_id'
|
||||
|
||||
check_query="SELECT sum(parts_to_do) FROM system.mutations WHERE table='mutation_table' and database='$CLICKHOUSE_DATABASE'"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
counter=0
|
||||
|
||||
while [ "$query_result" != "1" ]
|
||||
@ -59,7 +59,7 @@ do
|
||||
then
|
||||
break
|
||||
fi
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
sleep 0.5
|
||||
counter=$(($counter + 1))
|
||||
done
|
||||
|
@ -24,11 +24,11 @@ $CLICKHOUSE_CLIENT --query "ALTER TABLE replicated_mutation_table UPDATE key = k
|
||||
|
||||
check_query="SELECT count() FROM system.mutations WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and mutation_id='0000000000'"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
|
||||
while [ "$query_result" != "1" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
@ -36,7 +36,7 @@ $CLICKHOUSE_CLIENT --query "KILL MUTATION WHERE table='replicated_mutation_table
|
||||
|
||||
while [ "$query_result" != "0" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
@ -46,11 +46,11 @@ $CLICKHOUSE_CLIENT --query "ALTER TABLE replicated_mutation_table MODIFY COLUMN
|
||||
|
||||
check_query="SELECT count() FROM system.mutations WHERE table='replicated_mutation_table' and database='$CLICKHOUSE_DATABASE' and mutation_id='0000000001'"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
|
||||
while [ "$query_result" != "1" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
@ -60,7 +60,7 @@ $CLICKHOUSE_CLIENT --query "KILL MUTATION WHERE table='replicated_mutation_table
|
||||
|
||||
while [ "$query_result" != "0" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
|
@ -30,11 +30,11 @@ function check_sticky_mutations()
|
||||
##### wait mutation to start #####
|
||||
check_query="SELECT count() FROM system.mutations WHERE table='sticking_mutations' and database='$CLICKHOUSE_DATABASE' and is_done = 0"
|
||||
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
|
||||
while [ "$query_result" == "0" ]
|
||||
do
|
||||
query_result=`$CLICKHOUSE_CLIENT --query="$check_query" 2>&1`
|
||||
query_result=$($CLICKHOUSE_CLIENT --query="$check_query" 2>&1)
|
||||
sleep 0.5
|
||||
done
|
||||
##### wait mutation to start #####
|
||||
|
@ -31,13 +31,13 @@ export CLICKHOUSE_FORMAT=${CLICKHOUSE_FORMAT:="$CLICKHOUSE_BINARY-format"}
|
||||
export CLICKHOUSE_CONFIG_GREP=${CLICKHOUSE_CONFIG_GREP:="/etc/clickhouse-server/preprocessed/config.xml"}
|
||||
|
||||
export CLICKHOUSE_HOST=${CLICKHOUSE_HOST:="localhost"}
|
||||
export CLICKHOUSE_PORT_TCP=${CLICKHOUSE_PORT_TCP:=`${CLICKHOUSE_EXTRACT_CONFIG} --try --key=tcp_port 2>/dev/null`} 2>/dev/null
|
||||
export CLICKHOUSE_PORT_TCP=${CLICKHOUSE_PORT_TCP:=$(${CLICKHOUSE_EXTRACT_CONFIG} --try --key=tcp_port 2>/dev/null)} 2>/dev/null
|
||||
export CLICKHOUSE_PORT_TCP=${CLICKHOUSE_PORT_TCP:="9000"}
|
||||
export CLICKHOUSE_PORT_TCP_SECURE=${CLICKHOUSE_PORT_TCP_SECURE:=`${CLICKHOUSE_EXTRACT_CONFIG} --try --key=tcp_port_secure 2>/dev/null`} 2>/dev/null
|
||||
export CLICKHOUSE_PORT_TCP_SECURE=${CLICKHOUSE_PORT_TCP_SECURE:=$(${CLICKHOUSE_EXTRACT_CONFIG} --try --key=tcp_port_secure 2>/dev/null)} 2>/dev/null
|
||||
export CLICKHOUSE_PORT_TCP_SECURE=${CLICKHOUSE_PORT_TCP_SECURE:="9440"}
|
||||
export CLICKHOUSE_PORT_HTTP=${CLICKHOUSE_PORT_HTTP:=`${CLICKHOUSE_EXTRACT_CONFIG} --key=http_port 2>/dev/null`}
|
||||
export CLICKHOUSE_PORT_HTTP=${CLICKHOUSE_PORT_HTTP:=$(${CLICKHOUSE_EXTRACT_CONFIG} --key=http_port 2>/dev/null)}
|
||||
export CLICKHOUSE_PORT_HTTP=${CLICKHOUSE_PORT_HTTP:="8123"}
|
||||
export CLICKHOUSE_PORT_HTTPS=${CLICKHOUSE_PORT_HTTPS:=`${CLICKHOUSE_EXTRACT_CONFIG} --try --key=https_port 2>/dev/null`} 2>/dev/null
|
||||
export CLICKHOUSE_PORT_HTTPS=${CLICKHOUSE_PORT_HTTPS:=$(${CLICKHOUSE_EXTRACT_CONFIG} --try --key=https_port 2>/dev/null)} 2>/dev/null
|
||||
export CLICKHOUSE_PORT_HTTPS=${CLICKHOUSE_PORT_HTTPS:="8443"}
|
||||
export CLICKHOUSE_PORT_HTTP_PROTO=${CLICKHOUSE_PORT_HTTP_PROTO:="http"}
|
||||
|
||||
@ -59,7 +59,7 @@ then
|
||||
export CLICKHOUSE_URL_HTTPS="${CLICKHOUSE_URL_HTTPS}?${CLICKHOUSE_URL_PARAMS}"
|
||||
fi
|
||||
|
||||
export CLICKHOUSE_PORT_INTERSERVER=${CLICKHOUSE_PORT_INTERSERVER:=`${CLICKHOUSE_EXTRACT_CONFIG} --try --key=interserver_http_port 2>/dev/null`} 2>/dev/null
|
||||
export CLICKHOUSE_PORT_INTERSERVER=${CLICKHOUSE_PORT_INTERSERVER:=$(${CLICKHOUSE_EXTRACT_CONFIG} --try --key=interserver_http_port 2>/dev/null)} 2>/dev/null
|
||||
export CLICKHOUSE_PORT_INTERSERVER=${CLICKHOUSE_PORT_INTERSERVER:="9009"}
|
||||
export CLICKHOUSE_URL_INTERSERVER=${CLICKHOUSE_URL_INTERSERVER:="${CLICKHOUSE_PORT_HTTP_PROTO}://${CLICKHOUSE_HOST}:${CLICKHOUSE_PORT_INTERSERVER}/"}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user