ClickHouse/tests/queries/0_stateless/02014_query_parameters.sh
Nikolay Degterinsky 3139968b99 Try fix test
2021-09-15 17:11:42 +03:00

18 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Tags: no-parallel
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
${CLICKHOUSE_CLIENT} --query "DROP DATABASE IF EXISTS test_db";
${CLICKHOUSE_CLIENT} --param_database="test_db" --query "CREATE DATABASE {database:Identifier}";
${CLICKHOUSE_CLIENT} --query "CREATE TABLE test_db.test_parameters (id UInt64, col1 UInt64) ENGINE = MergeTree() ORDER BY id";
${CLICKHOUSE_CLIENT} --query "TRUNCATE TABLE test_db.test_parameters";
${CLICKHOUSE_CLIENT} --query "INSERT INTO test_db.test_parameters VALUES (0,0)";
${CLICKHOUSE_CLIENT} --param_table="test_parameters" --query "OPTIMIZE TABLE test_db.{table:Identifier}";
${CLICKHOUSE_CLIENT} --param_table="test_parameters" --query "ALTER TABLE test_db.{table:Identifier} RENAME COLUMN col1 to col2";
${CLICKHOUSE_CLIENT} --param_table="test_parameters" --query "EXISTS TABLE test_db.{table:Identifier}";
${CLICKHOUSE_CLIENT} --param_table="test_parameters" --query "DROP TABLE test_db.{table:Identifier}";
${CLICKHOUSE_CLIENT} --param_database="test_db" --query "DROP DATABASE {database:Identifier}";