mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #22063 from ClickHouse/tuple-null-in
Allow to search tuple of NULLs in a set
This commit is contained in:
commit
37a4f3ab3a
@ -377,6 +377,11 @@ Field convertFieldToType(const Field & from_value, const IDataType & to_type, co
|
||||
else if (const auto * nullable_type = typeid_cast<const DataTypeNullable *>(&to_type))
|
||||
{
|
||||
const IDataType & nested_type = *nullable_type->getNestedType();
|
||||
|
||||
/// NULL remains NULL after any conversion.
|
||||
if (WhichDataType(nested_type).isNothing())
|
||||
return {};
|
||||
|
||||
if (from_type_hint && from_type_hint->equals(nested_type))
|
||||
return from_value;
|
||||
return convertFieldToTypeImpl(from_value, nested_type, from_type_hint);
|
||||
|
2
tests/queries/0_stateless/01774_tuple_null_in.reference
Normal file
2
tests/queries/0_stateless/01774_tuple_null_in.reference
Normal file
@ -0,0 +1,2 @@
|
||||
0
|
||||
0
|
2
tests/queries/0_stateless/01774_tuple_null_in.sql
Normal file
2
tests/queries/0_stateless/01774_tuple_null_in.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SELECT (NULL, NULL) = (8, 0) OR (NULL, NULL) = (3, 2) OR (NULL, NULL) = (0, 0) OR (NULL, NULL) = (3, 1);
|
||||
SELECT (NULL, NULL) IN ((NULL, 0), (3, 1), (3, 2), (8, 0), (NULL, NULL));
|
Loading…
Reference in New Issue
Block a user