mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Fix tests
This commit is contained in:
parent
1c15ad54f4
commit
a577c87cf1
@ -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(...)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
(
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user