mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Added support for non-constant and negative offset and size for substring function (continued) [#CLICKHOUSE-2].
This commit is contained in:
parent
94768fe9bf
commit
3144cbc9c1
@ -878,7 +878,7 @@ public:
|
||||
{
|
||||
start_value = column_start_const->getInt(0);
|
||||
if (start_value > 0x8000000000000000ULL) /// Larger value could lead to overflow, then bypass bounds checking and read wrong data.
|
||||
throw Exception("Too large values of second argument provided for function substring.", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
throw Exception("Too large value of second argument provided for function substring.", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
}
|
||||
if (column_length_const)
|
||||
{
|
||||
@ -886,7 +886,7 @@ public:
|
||||
if (length_value < 0)
|
||||
throw Exception("Third argument provided for function substring could not be negative.", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
if (length_value > 0x8000000000000000ULL)
|
||||
throw Exception("Too large values of second argument provided for function substring.", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
throw Exception("Too large value of third argument provided for function substring.", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
}
|
||||
|
||||
if (const ColumnString * col = checkAndGetColumn<ColumnString>(&*column_string))
|
||||
|
Loading…
Reference in New Issue
Block a user