UUIDStringToNum/UUIDNumToString: enforce second parameter to be constant

This commit is contained in:
Igor Nikonov 2024-04-25 17:12:50 +00:00
parent ee7f862155
commit a4a6581be3
3 changed files with 8 additions and 1 deletions

View File

@ -174,6 +174,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
{ {
@ -252,6 +253,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
{ {

View File

@ -0,0 +1,2 @@
3"\0UDwfˆ™ª»ÌÝîÿ
a/<@];!~p{jTj={) 403c2f61-3b5d-7e21-707b-6a546a3d7b29

View File

@ -1 +1,4 @@
SELECT UUIDStringToNum('00112233-4455-6677-8899-aabbccddeeff', materialize(2)) -- { serverError ILLEGAL_COLUMN } 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 }