mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Fix bug in arrayEnumerateRanked
This commit is contained in:
parent
a233b93b6a
commit
9159d602f5
@ -51,11 +51,11 @@ ArraysDepths getArraysDepths(const ColumnsWithTypeAndName & arguments)
|
||||
|
||||
if (depth_column && depth_column->isColumnConst())
|
||||
{
|
||||
auto value = depth_column->getUInt(0);
|
||||
if (!value)
|
||||
auto value = depth_column->getInt(0);
|
||||
if (value <= 0)
|
||||
throw Exception(
|
||||
"Arguments for function arrayEnumerateUniqRanked/arrayEnumerateDenseRanked incorrect: depth ("
|
||||
+ std::to_string(value) + ") cant be 0.",
|
||||
+ std::to_string(value) + ") cant be less or equal 0.",
|
||||
ErrorCodes::BAD_ARGUMENTS);
|
||||
|
||||
if (i == 0)
|
||||
|
@ -172,3 +172,7 @@ SELECT arrayEnumerateUniqRanked([1,2], 1, 3, [4], 5); -- { serverError 36 }
|
||||
SELECT arrayEnumerateDenseRanked([[[[[[[[[[42]]]]]]]]]]);
|
||||
SELECT arrayEnumerateUniqRanked('wat', [1,2]); -- { serverError 48 }
|
||||
SELECT arrayEnumerateUniqRanked(1, [1,2], 'boom'); -- { serverError 48 }
|
||||
SELECT arrayEnumerateDenseRanked(['\0'], -8363126); -- { serverError 36 }
|
||||
SELECT arrayEnumerateDenseRanked(-10, ['\0'], -8363126); -- { serverError 36 }
|
||||
SELECT arrayEnumerateDenseRanked(1, ['\0'], -8363126); -- { serverError 36 }
|
||||
SELECT arrayEnumerateDenseRanked(-101, ['\0']); -- { serverError 36 }
|
||||
|
Loading…
Reference in New Issue
Block a user