mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Merge pull request #62610 from ClickHouse/fix-msan-uuid-string-to-num
Fix: msan in UUIDStringToNum
This commit is contained in:
commit
f22c27c76b
@ -130,6 +130,7 @@ UUIDSerializer::Variant parseVariant(const DB::ColumnsWithTypeAndName & argument
|
|||||||
|
|
||||||
const auto representation = static_cast<magic_enum::underlying_type_t<UUIDSerializer::Variant>>(arguments[1].column->getInt(0));
|
const auto representation = static_cast<magic_enum::underlying_type_t<UUIDSerializer::Variant>>(arguments[1].column->getInt(0));
|
||||||
const auto as_enum = magic_enum::enum_cast<UUIDSerializer::Variant>(representation);
|
const auto as_enum = magic_enum::enum_cast<UUIDSerializer::Variant>(representation);
|
||||||
|
|
||||||
if (!as_enum)
|
if (!as_enum)
|
||||||
throw DB::Exception(DB::ErrorCodes::ARGUMENT_OUT_OF_BOUND, "Expected UUID variant, got {}", representation);
|
throw DB::Exception(DB::ErrorCodes::ARGUMENT_OUT_OF_BOUND, "Expected UUID variant, got {}", representation);
|
||||||
|
|
||||||
@ -170,6 +171,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool useDefaultImplementationForConstants() const override { return true; }
|
bool useDefaultImplementationForConstants() const override { return true; }
|
||||||
|
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; }
|
||||||
|
|
||||||
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t /*input_rows_count*/) const override
|
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t /*input_rows_count*/) const override
|
||||||
{
|
{
|
||||||
@ -248,6 +250,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool useDefaultImplementationForConstants() const override { return true; }
|
bool useDefaultImplementationForConstants() const override { return true; }
|
||||||
|
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; }
|
||||||
|
|
||||||
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t /*input_rows_count*/) const override
|
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t /*input_rows_count*/) const override
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
3"\0UDwfˆ™ª»ÌÝîÿ
|
||||||
|
a/<@];!~p{jTj={) 403c2f61-3b5d-7e21-707b-6a546a3d7b29
|
@ -0,0 +1,4 @@
|
|||||||
|
SELECT UUIDStringToNum('00112233-4455-6677-8899-aabbccddeeff', 2);
|
||||||
|
SELECT UUIDStringToNum('00112233-4455-6677-8899-aabbccddeeff', materialize(2)); -- { serverError ILLEGAL_COLUMN }
|
||||||
|
SELECT 'a/<@];!~p{jTj={)' AS bytes, UUIDNumToString(toFixedString(bytes, 16), 2) AS uuid;
|
||||||
|
SELECT 'a/<@];!~p{jTj={)' AS bytes, UUIDNumToString(toFixedString(bytes, 16), materialize(2)) AS uuid; -- { serverError ILLEGAL_COLUMN }
|
Loading…
Reference in New Issue
Block a user