add tests

This commit is contained in:
bharatnc 2020-08-26 13:05:17 -07:00
parent 3a35aedb56
commit b019a70ed2
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,5 @@
--- CREATE TABLE with INVALID index_granularity_bytes i.e.index_granularity_bytes < min_index_granularity_bytes ---
--- INSERT INTO TABLE invalid_min_index_granularity_bytes_setting ---
--- CREATE TABLE with VALID index_granularity_bytes i.e index_granularity_bytes > min_index_granularity_bytes ---
--- INSERT INTO TABLE valid_min_index_granularity_bytes_setting ---
1

View File

@ -0,0 +1,34 @@
DROP TABLE IF EXISTS invalid_min_index_granularity_bytes_setting;
SELECT '--- CREATE TABLE with INVALID index_granularity_bytes i.e.index_granularity_bytes < min_index_granularity_bytes ---';
CREATE TABLE invalid_min_index_granularity_bytes_setting
(
id UInt64,
value String
) ENGINE MergeTree()
ORDER BY id SETTINGS index_granularity_bytes = 1, min_index_granularity_bytes = 1024; -- should result in exception
SELECT '--- INSERT INTO TABLE invalid_min_index_granularity_bytes_setting ---';
INSERT INTO invalid_min_index_granularity_bytes_setting SELECT number, concat('xxxxxxxxxx', toString(number)) FROM numbers(1000,1000); -- should result in exception
DROP TABLE IF EXISTS invalid_min_index_granularity_bytes_setting;
DROP TABLE IF EXISTS valid_min_index_granularity_bytes_setting;
SELECT '--- CREATE TABLE with VALID index_granularity_bytes i.e index_granularity_bytes > min_index_granularity_bytes ---';
CREATE TABLE valid_min_index_granularity_bytes_setting
(
id UInt64,
value String
) ENGINE MergeTree()
ORDER BY id SETTINGS index_granularity_bytes = 2024, min_index_granularity_bytes = 1024; -- should NOT result in exception
SELECT '--- INSERT INTO TABLE valid_min_index_granularity_bytes_setting ---';
INSERT INTO valid_min_index_granularity_bytes_setting SELECT number, concat('xxxxxxxxxx', toString(number)) FROM numbers(1000,1000); -- should result in exception
SELECT COUNT(*) from valid_min_index_granularity_bytes_setting WHERE value = 'xxxxxxxxxx1015';
DROP TABLE IF EXISTS valid_min_index_granularity_bytes_setting;