2023-05-04 16:16:11 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-05-05 12:00:18 +00:00
|
|
|
# Tags: no-fasttest, no-s3-storage
|
2023-05-04 16:16:11 +00:00
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
# shellcheck source=../shell_config.sh
|
|
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
|
2023-07-28 12:20:48 +00:00
|
|
|
for DISK in s3_disk s3_cache
|
|
|
|
do
|
|
|
|
${CLICKHOUSE_CLIENT} -n --query "
|
|
|
|
DROP TABLE IF EXISTS test;
|
|
|
|
CREATE TABLE test (id Int32, empty Array(Int32))
|
|
|
|
ENGINE=MergeTree ORDER BY id
|
|
|
|
SETTINGS min_rows_for_wide_part=0, min_bytes_for_wide_part=0, disk='$DISK';
|
2023-05-04 16:16:11 +00:00
|
|
|
|
2023-07-28 12:20:48 +00:00
|
|
|
INSERT INTO test (id) VALUES (1);
|
|
|
|
SELECT * FROM test;
|
|
|
|
"
|
2023-05-04 16:16:11 +00:00
|
|
|
|
2023-07-28 12:20:48 +00:00
|
|
|
${CLICKHOUSE_CLIENT} -n --query "
|
|
|
|
BACKUP TABLE test TO Disk('backups', 'test_s3_backup');
|
|
|
|
DROP TABLE test;
|
|
|
|
RESTORE TABLE test FROM Disk('backups', 'test_s3_backup');
|
|
|
|
" &>/dev/null
|
2023-05-04 16:16:11 +00:00
|
|
|
|
2023-07-28 12:20:48 +00:00
|
|
|
${CLICKHOUSE_CLIENT} -n --query "
|
|
|
|
SELECT * FROM test;
|
|
|
|
SELECT empty FROM test;
|
|
|
|
"
|
|
|
|
done
|