Fix segmentation fault

This commit is contained in:
alesapin 2019-10-17 20:53:08 +03:00
parent c29b39002d
commit b222ec1209
3 changed files with 14 additions and 2 deletions

View File

@ -100,7 +100,9 @@ DatabaseTablesIteratorPtr DatabaseWithOwnTablesBase::getTablesWithDictionaryTabl
while (dictionaries_it && dictionaries_it->isValid())
{
auto table_name = dictionaries_it->name();
result.emplace(table_name, getDictionaryStorage(context, table_name, getDatabaseName()));
auto table_ptr = getDictionaryStorage(context, table_name, getDatabaseName());
if (table_ptr)
result.emplace(table_name, table_ptr);
dictionaries_it->next();
}

View File

@ -6,3 +6,11 @@
300
300
300
dict1
dict2
dict3
table_for_dict
dict1
dict2
dict3
dict4

View File

@ -65,7 +65,6 @@ SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'dict2' DB 'da
LIFETIME(MIN 1 MAX 10)
LAYOUT(HASHED());
SELECT count(*) FROM database_for_dict.dict3;
INSERT INTO database_for_dict.table_for_dict SELECT number, number % 17, toString(number * number), number / 2.0 from numbers(200, 100);
@ -91,6 +90,9 @@ LAYOUT(HASHED());
SELECT count(*) FROM database_for_dict.dict4; -- {serverError 60}
SELECT name from system.tables WHERE database = 'database_for_dict' ORDER BY name;
SELECT name from system.dictionaries WHERE database = 'database_for_dict' ORDER BY name;
DROP DATABASE IF EXISTS database_for_dict;
SELECT count(*) from database_for_dict.dict3; --{serverError 81}