Fix broken test

This commit is contained in:
alesapin 2022-12-20 14:00:17 +01:00
parent 06652b7d1f
commit 10ea709931
2 changed files with 29 additions and 20 deletions

View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Tags: no-parallel
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
FILE_NAME="${CLICKHOUSE_DATABASE}_test.native.zstd"
${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test"
${CLICKHOUSE_CLIENT} --query "CREATE TABLE test (a Int64, b Int64 MATERIALIZED a) ENGINE = MergeTree() PRIMARY KEY tuple()"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test VALUES (1)"
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test"
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test INTO OUTFILE '${CLICKHOUSE_TMP}/${FILE_NAME}' FORMAT Native"
${CLICKHOUSE_CLIENT} --query "TRUNCATE TABLE test"
${CLICKHOUSE_CLIENT} --query "INSERT INTO test FROM INFILE '${CLICKHOUSE_TMP}/${FILE_NAME}'"
${CLICKHOUSE_CLIENT} --query "SELECT * FROM test"
${CLICKHOUSE_CLIENT} --query "DROP TABLE test"
rm -f "${CLICKHOUSE_TMP}/${FILE_NAME}"

View File

@ -1,20 +0,0 @@
-- Tags: no-parallel
DROP TABLE IF EXISTS test;
create table test (
a Int64,
b Int64 materialized a
)
engine = MergeTree()
primary key tuple();
insert into test values (1);
SELECT * FROM test;
select * from test into outfile 'test.native.zstd' format Native;
truncate table test;
insert into test from infile 'test.native.zstd';
SELECT * FROM test;
DROP TABLE test;