fix function 'empty' with uuid type

This commit is contained in:
Anton Popov 2021-11-26 17:39:03 +03:00
parent de7f5dc2a5
commit 7237343fd6
3 changed files with 12 additions and 1 deletions

View File

@ -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);
}
};

View 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

View 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;