mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
Fix crash in ObjectJson parsing array with nulls
This commit is contained in:
parent
948ec2ba86
commit
6b954fcfd4
@ -1001,6 +1001,11 @@ Field FieldVisitorFoldDimension::operator()(const Array & x) const
|
||||
return res;
|
||||
}
|
||||
|
||||
Field FieldVisitorFoldDimension::operator()(const Null &) const
|
||||
{
|
||||
return Array();
|
||||
}
|
||||
|
||||
void setAllObjectsToDummyTupleType(NamesAndTypesList & columns)
|
||||
{
|
||||
for (auto & column : columns)
|
||||
|
@ -139,7 +139,7 @@ public:
|
||||
|
||||
Field operator()(const Array & x) const;
|
||||
|
||||
Field operator()(const Null & x) const { return x; }
|
||||
Field operator()(const Null & x) const;
|
||||
|
||||
template <typename T>
|
||||
Field operator()(const T & x) const
|
||||
|
@ -16,3 +16,4 @@
|
||||
{"x":[[],[1,2]]}
|
||||
{"x":[[],[[1],[2]]]}
|
||||
{"x":[[],[[],[2]]]}
|
||||
{"a.a":[[1],[]]}
|
||||
|
@ -32,3 +32,4 @@ SELECT CAST('{"x" : [ 1 , [ 1 , 2] ]}', 'Object(\'json\')');
|
||||
SELECT CAST('{"x" : [ {} , [ 1 , 2] ]}', 'Object(\'json\')');
|
||||
SELECT CAST('{"x" : [ {} , [ 1 , [2]] ]}', 'Object(\'json\')');
|
||||
SELECT CAST('{"x" : [ {} , [ {} , [2]] ]}', 'Object(\'json\')');
|
||||
SELECT CAST(' {"a": { "a": [ [1], null ] } }', 'Object(Nullable(\'json\'))');
|
||||
|
Loading…
Reference in New Issue
Block a user