mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12: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
11497742bd
commit
bbf6d36072
@ -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