Merge pull request #27918 from vitlibar/fix-low-cardinality-uuid-with-extremes

Fix selecting with extremes from LowCardinality(UUID)
This commit is contained in:
alexey-milovidov 2021-08-21 10:34:33 +03:00 committed by GitHub
commit adc63ce279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -304,7 +304,7 @@ size_t ColumnUnique<ColumnType>::uniqueInsert(const Field & x)
if (x.getType() == Field::Types::Null)
return getNullValueIndex();
if (isNumeric())
if (valuesHaveFixedSize())
return uniqueInsertData(&x.reinterpret<char>(), size_of_value_if_fixed);
auto & val = x.get<String>();

View File

@ -0,0 +1,4 @@
0562380c-d1f3-4091-83d5-8c972f534317
0562380c-d1f3-4091-83d5-8c972f534317
0562380c-d1f3-4091-83d5-8c972f534317

View File

@ -0,0 +1,11 @@
DROP TABLE IF EXISTS tbl;
SET allow_suspicious_low_cardinality_types = 1;
CREATE TABLE tbl (`lc` LowCardinality(UUID)) ENGINE = Memory;
INSERT INTO tbl VALUES ('0562380c-d1f3-4091-83d5-8c972f534317');
SET extremes = 1;
SELECT * FROM tbl;
DROP TABLE tbl;