From 09a7b9bc1738efc475aef2853555072cab9dd937 Mon Sep 17 00:00:00 2001 From: kssenii Date: Thu, 4 May 2023 18:16:11 +0200 Subject: [PATCH] Add test --- .../02731_zero_objects_in_metadata.reference | 3 +++ .../02731_zero_objects_in_metadata.sh | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tests/queries/0_stateless/02731_zero_objects_in_metadata.reference create mode 100755 tests/queries/0_stateless/02731_zero_objects_in_metadata.sh diff --git a/tests/queries/0_stateless/02731_zero_objects_in_metadata.reference b/tests/queries/0_stateless/02731_zero_objects_in_metadata.reference new file mode 100644 index 00000000000..125915f4f65 --- /dev/null +++ b/tests/queries/0_stateless/02731_zero_objects_in_metadata.reference @@ -0,0 +1,3 @@ +1 [] +1 [] +[] diff --git a/tests/queries/0_stateless/02731_zero_objects_in_metadata.sh b/tests/queries/0_stateless/02731_zero_objects_in_metadata.sh new file mode 100755 index 00000000000..31f7474089a --- /dev/null +++ b/tests/queries/0_stateless/02731_zero_objects_in_metadata.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +# shellcheck source=../shell_config.sh +. "$CURDIR"/../shell_config.sh + +${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, storage_policy='s3'; + +INSERT INTO test (id) VALUES (1); +SELECT * FROM test; +" + +${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 + +${CLICKHOUSE_CLIENT} -n --query " +SELECT * FROM test; +SELECT empty FROM test; +"