mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #31883 from CurtizJ/fix-empty-uuid
Fix function `empty` with `UUID` type
This commit is contained in:
commit
75ac0f72bc
@ -58,7 +58,7 @@ struct EmptyImpl
|
||||
static void uuid(const ColumnUUID::Container & container, size_t n, PaddedPODArray<UInt8> & res)
|
||||
{
|
||||
for (size_t i = 0; i < n; ++i)
|
||||
res[i] = negative ^ (container.data()->toUnderType() == 0);
|
||||
res[i] = negative ^ (container[i].toUnderType() == 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
4
tests/queries/0_stateless/02124_empty_uuid.reference
Normal file
4
tests/queries/0_stateless/02124_empty_uuid.reference
Normal file
@ -0,0 +1,4 @@
|
||||
00000000-0000-0000-0000-000000000000 1
|
||||
992f6910-42b2-43cd-98bc-c812fbf9b683 0
|
||||
992f6910-42b2-43cd-98bc-c812fbf9b683 0
|
||||
00000000-0000-0000-0000-000000000000 1
|
7
tests/queries/0_stateless/02124_empty_uuid.sql
Normal file
7
tests/queries/0_stateless/02124_empty_uuid.sql
Normal file
@ -0,0 +1,7 @@
|
||||
SELECT
|
||||
arrayJoin([toUUID('00000000-0000-0000-0000-000000000000'), toUUID('992f6910-42b2-43cd-98bc-c812fbf9b683')]) AS x,
|
||||
empty(x) AS emp;
|
||||
|
||||
SELECT
|
||||
arrayJoin([toUUID('992f6910-42b2-43cd-98bc-c812fbf9b683'), toUUID('00000000-0000-0000-0000-000000000000')]) AS x,
|
||||
empty(x) AS emp;
|
Loading…
Reference in New Issue
Block a user