ClickHouse/tests/queries/0_stateless/00557_remote_port.sh

32 lines
1.4 KiB
Bash
Raw Normal View History

2018-01-11 17:28:49 +00:00
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
2020-12-28 11:46:53 +00:00
# shellcheck source=../shell_config.sh
2020-08-01 00:51:12 +00:00
. "$CURDIR"/../shell_config.sh
2018-01-11 17:28:49 +00:00
if [ "$CLICKHOUSE_HOST" == "localhost" ]; then
2018-01-11 17:28:49 +00:00
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote('127.0.0.1', system, one);"
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote('127.0.0.{1,1}', system, one);"
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote('127.0.0.1:${CLICKHOUSE_PORT_TCP}', system, one);"
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote('127.0.0.{1,1}:${CLICKHOUSE_PORT_TCP}', system, one);"
else
# Can't test without localhost
echo 0
echo 0
echo 0
echo 0
2018-01-11 21:30:34 +00:00
echo 0
echo 0
2018-01-11 17:28:49 +00:00
fi
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote('${CLICKHOUSE_HOST}', system, one);"
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote('${CLICKHOUSE_HOST}:${CLICKHOUSE_PORT_TCP}', system, one);"
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote(test_shard_localhost, system, one);"
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote(test_shard_localhost, system, one, 'default', '');"
$CLICKHOUSE_CLIENT -q "SELECT * FROM cluster('test_shard_localhost', system, one);"
2019-06-14 15:59:56 +00:00
# Actually tcp_port is not used because we query localhost and it is done without IPC into clickhouse-local itself.
$CLICKHOUSE_LOCAL --query "SELECT count() FROM remote('127.0.0.1', system.one)"
$CLICKHOUSE_LOCAL --query "SELECT count() FROM remote('127.0.0.1', system.one)" -- --tcp_port=59000