mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
dbms: ClickHouseDictionarySource: check that key is present before dereferencing [#METR-18945]
This commit is contained in:
parent
f67c8e63a2
commit
6d42868283
@ -42,7 +42,7 @@ public:
|
||||
"ClickHouseDictionarySource")
|
||||
},
|
||||
load_all_query{composeLoadAllQuery()},
|
||||
key_tuple_definition{composeKeyTupleDefinition()}
|
||||
key_tuple_definition{dict_struct.key ? composeKeyTupleDefinition() : std::string{}}
|
||||
{}
|
||||
|
||||
/// copy-constructor is provided in order to support cloneability
|
||||
@ -318,6 +318,9 @@ private:
|
||||
|
||||
std::string composeKeyTupleDefinition() const
|
||||
{
|
||||
if (!dict_struct.key)
|
||||
throw Exception{"Composite key required for method", ErrorCodes::UNSUPPORTED_METHOD};
|
||||
|
||||
std::string result{"("};
|
||||
|
||||
auto first = true;
|
||||
|
Loading…
Reference in New Issue
Block a user