mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
ClickHouse: throwing exception on nested nested types. [#CONV-2807]
This commit is contained in:
parent
a997258e26
commit
6a63256dc9
@ -210,6 +210,7 @@ namespace ErrorCodes
|
||||
TOO_MUCH_SIMULTANEOUS_QUERIES,
|
||||
NO_FREE_CONNECTION,
|
||||
CANNOT_FSYNC,
|
||||
NESTED_TYPE_TOO_DEEP,
|
||||
|
||||
POCO_EXCEPTION = 1000,
|
||||
STD_EXCEPTION,
|
||||
|
@ -114,9 +114,12 @@ DataTypePtr DataTypeFactory::get(const String & name) const
|
||||
{
|
||||
ASTNameTypePair & name_and_type_pair = dynamic_cast<ASTNameTypePair &>(**it);
|
||||
StringRange type_range = name_and_type_pair.type->range;
|
||||
DataTypePtr type = get(String(type_range.first, type_range.second - type_range.first));
|
||||
if (dynamic_cast<const DataTypeNested*>(&*type))
|
||||
throw Exception("Nested inside Nested is not allowed", ErrorCodes::NESTED_TYPE_TOO_DEEP);
|
||||
columns->push_back(NameAndTypePair(
|
||||
name_and_type_pair.name,
|
||||
get(String(type_range.first, type_range.second - type_range.first))));
|
||||
type));
|
||||
}
|
||||
|
||||
return new DataTypeNested(columns);
|
||||
|
Loading…
Reference in New Issue
Block a user