Fix tests

This commit is contained in:
avogar 2024-06-18 20:21:20 +00:00
parent 1c15ad54f4
commit a577c87cf1
15 changed files with 22 additions and 33 deletions

View File

@ -95,6 +95,11 @@ namespace
as_table.database = current_database;
dependencies.emplace(as_table);
}
/// Visit nested select query only for views, for other cases it's not
/// an actual dependency as it will be executed only once to fill the table.
if (create.select && !create.isView())
skip_asts.insert(create.select);
}
/// The definition of a dictionary: SOURCE(CLICKHOUSE(...)) LAYOUT(...) LIFETIME(...)

View File

@ -9,10 +9,6 @@ CREATE TABLE distr (x UInt8) ENGINE = Distributed(test_shard_localhost, currentD
CREATE TABLE distr0 (x UInt8) ENGINE = Distributed(test_shard_localhost, '', distr0); -- { serverError INFINITE_LOOP }
CREATE TABLE distr1 (x UInt8) ENGINE = Distributed(test_shard_localhost, currentDatabase(), distr2);
CREATE TABLE distr2 (x UInt8) ENGINE = Distributed(test_shard_localhost, currentDatabase(), distr1);
SELECT * FROM distr1; -- { serverError TOO_LARGE_DISTRIBUTED_DEPTH }
SELECT * FROM distr2; -- { serverError TOO_LARGE_DISTRIBUTED_DEPTH }
CREATE TABLE distr2 (x UInt8) ENGINE = Distributed(test_shard_localhost, currentDatabase(), distr1); -- { serverError INFINITE_LOOP }
DROP TABLE distr1;
DROP TABLE distr2;

View File

@ -16,5 +16,5 @@ LIFETIME(MIN 10 MAX 10);
SELECT dictGet(currentDatabase() || '.dict', 's', number) FROM numbers(2);
DROP TABLE src;
DROP DICTIONARY dict;
DROP TABLE src;

View File

@ -27,5 +27,5 @@ SELECT dictGet('ddl_dictionary_test', 'value', number) FROM system.numbers LIMIT
SELECT 'dictHas';
SELECT dictHas('ddl_dictionary_test', number) FROM system.numbers LIMIT 3;
DROP TABLE ddl_dictonary_test_source;
DROP DICTIONARY ddl_dictionary_test;
DROP TABLE ddl_dictonary_test_source;

View File

@ -17,19 +17,6 @@ ENGINE = Distributed('test_shard_localhost', '', 'tt7', rand());
DROP TABLE IF EXISTS tt7;
CREATE TABLE tt7 as tt6 ENGINE = Distributed('test_shard_localhost', '', 'tt6', rand());
INSERT INTO tt6 VALUES (1, 1, 1, 1, 'ok'); -- { serverError TOO_LARGE_DISTRIBUTED_DEPTH }
SELECT * FROM tt6; -- { serverError TOO_LARGE_DISTRIBUTED_DEPTH }
SET max_distributed_depth = 0;
-- stack overflow
INSERT INTO tt6 VALUES (1, 1, 1, 1, 'ok'); -- { serverError TOO_DEEP_RECURSION}
-- stack overflow
SELECT * FROM tt6; -- { serverError TOO_DEEP_RECURSION }
CREATE TABLE tt7 as tt6 ENGINE = Distributed('test_shard_localhost', '', 'tt6', rand()); -- {serverError INFINITE_LOOP}
DROP TABLE tt6;
DROP TABLE tt7;

View File

@ -23,5 +23,5 @@ LAYOUT(DIRECT());
SELECT * FROM dictionary('table_function_dictionary_test_dictionary');
DROP TABLE table_function_dictionary_source_table;
DROP DICTIONARY table_function_dictionary_test_dictionary;
DROP TABLE table_function_dictionary_source_table;

View File

@ -25,6 +25,8 @@ LAYOUT(FLAT());
SELECT 'Flat dictionary';
SELECT dictGet('flat_dictionary', 'decimal_value', toUInt64(1));
DROP DICTIONARY flat_dictionary;
DROP DICTIONARY IF EXISTS hashed_dictionary;
CREATE DICTIONARY hashed_dictionary
(

View File

@ -111,6 +111,8 @@ LAYOUT(IP_TRIE());
SELECT 'IPTrie dictionary';
SELECT dictGet('ip_trie_dictionary', 'value', tuple(IPv4StringToNum('127.0.0.0'))); --{serverError UNSUPPORTED_METHOD}
DROP DICTIONARY ip_trie_dictionary;
DROP TABLE dictionary_nullable_source_table;
DROP TABLE dictionary_nullable_default_source_table;

View File

@ -45,5 +45,5 @@ FROM numbers(3);
DROP TABLE dictionary_source_en;
DROP TABLE dictionary_source_ru;
DROP TABLE dictionary_source_view;
DROP DICTIONARY flat_dictionary;
DROP TABLE dictionary_source_view;

View File

@ -53,8 +53,8 @@ SELECT CountryID, StartDate, Tax FROM range_dictionary ORDER BY CountryID, Start
SELECT 'onlySpecificColumn';
SELECT Tax FROM range_dictionary ORDER BY CountryID, StartDate, EndDate;
DROP TABLE date_table;
DROP DICTIONARY range_dictionary;
DROP TABLE date_table;
CREATE TABLE date_table
(
@ -107,5 +107,5 @@ SELECT CountryID, StartDate, Tax FROM range_dictionary_nullable ORDER BY Country
SELECT 'onlySpecificColumn';
SELECT Tax FROM range_dictionary_nullable ORDER BY CountryID, StartDate, EndDate;
DROP TABLE date_table;
DROP DICTIONARY range_dictionary_nullable;
DROP TABLE date_table;

View File

@ -49,5 +49,5 @@ SELECT name, comment FROM system.tables WHERE name == '02155_test_dictionary_vie
SELECT name, comment FROM system.tables WHERE name == '02155_test_dictionary_view' AND database == currentDatabase();
DROP TABLE 02155_test_dictionary_view;
DROP TABLE 02155_test_table;
DROP DICTIONARY 02155_test_dictionary;
DROP TABLE 02155_test_table;

View File

@ -170,8 +170,8 @@ LIFETIME(0);
SELECT 'Polygon dictionary';
SELECT * FROM 02183_polygon_dictionary;
DROP DICTIONARY 02183_polygon_dictionr;
DROP TABLE 02183_polygon_dictionary_source_table;
DROP DICTIONARY 02183_polygon_dictionary;
DROP TABLE IF EXISTS 02183_range_dictionary_source_table;
CREATE TABLE 02183_range_dictionary_source_table

View File

@ -60,4 +60,5 @@ SELECT dictHas('02185_range_dictionary', 0, 0);
SELECT dictHas('02185_range_dictionary', 0, 5001);
SELECT dictHas('02185_range_dictionary', 0, 10001);
DROP DICTIONARY 02185_range_dictionary;
DROP TABLE 02185_range_dictionary_source_table;

View File

@ -10,9 +10,5 @@ DROP TABLE test;
DROP TABLE IF EXISTS test1;
DROP TABLE IF EXISTS test2;
CREATE TABLE test1 (key UInt32) Engine = Buffer(currentDatabase(), test2, 16, 10, 100, 10000, 1000000, 10000000, 100000000);
CREATE TABLE test2 (key UInt32) Engine = Buffer(currentDatabase(), test1, 16, 10, 100, 10000, 1000000, 10000000, 100000000);
SELECT * FROM test1; -- { serverError TOO_DEEP_RECURSION }
SELECT * FROM test2; -- { serverError TOO_DEEP_RECURSION }
SELECT * FROM system.tables WHERE table IN ('test1', 'test2') AND database = currentDatabase(); -- { serverError TOO_DEEP_RECURSION }
CREATE TABLE test2 (key UInt32) Engine = Buffer(currentDatabase(), test1, 16, 10, 100, 10000, 1000000, 10000000, 100000000); -- { serverError INFINITE_LOOP }
DROP TABLE test1;
DROP TABLE test2;

View File

@ -27,5 +27,5 @@ LAYOUT(COMPLEX_KEY_CACHE(SIZE_IN_CELLS 10));
SELECT dictGetOrDefault('cache_dictionary_complex_key_simple_attributes_short_circuit', 'value_first', (number, concat(toString(number))), toString(materialize('default'))) AS value_first FROM system.numbers LIMIT 20 FORMAT Null;
SELECT dictGetOrDefault('cache_dictionary_complex_key_simple_attributes_short_circuit', 'value_first', (number, concat(toString(number))), toString(materialize('default'))) AS value_first FROM system.numbers LIMIT 20 FORMAT Null;
DROP TABLE IF EXISTS complex_key_simple_attributes_source_short_circuit_table;
DROP DICTIONARY IF EXISTS cache_dictionary_complex_key_simple_attributes_short_circuit;
DROP TABLE IF EXISTS complex_key_simple_attributes_source_short_circuit_table;