ClickHouse/tests/queries/0_stateless/02916_joinget_dependency.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
943 B
Bash
Raw Normal View History

#!/usr/bin/env bash
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
# We test the dependency on the DROP
2024-08-07 10:55:16 +00:00
$CLICKHOUSE_CLIENT -m -q "
DROP TABLE IF EXISTS Sub_distributed;
DROP TABLE IF EXISTS Sub;
DROP TABLE IF EXISTS Mapping;
CREATE TABLE Mapping (Id UInt64, RegionId UInt64) ENGINE = Join(ANY,LEFT,Id);
INSERT INTO Mapping VALUES (1,1);
CREATE TABLE Sub (Id UInt64, PropertyId UInt64) ENGINE = MergeTree() PRIMARY KEY (Id) ORDER BY (Id);
CREATE TABLE Sub_distributed (Id UInt64, PropertyId UInt64)ENGINE = Distributed('test_shard_localhost', $CLICKHOUSE_DATABASE, Sub, joinGet('$CLICKHOUSE_DATABASE.Mapping','RegionId',PropertyId));"
$CLICKHOUSE_CLIENT -q "
DROP TABLE Mapping;
" 2>&1 | grep -cm1 "HAVE_DEPENDENT_OBJECTS"
2024-08-07 10:55:16 +00:00
$CLICKHOUSE_CLIENT -m -q "
DROP TABLE Sub_distributed;
DROP TABLE Sub;
DROP TABLE Mapping;
2024-08-07 10:55:16 +00:00
"