mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
Fix UBSan report in arraySlice
This commit is contained in:
parent
7d4945a073
commit
fb71a0704e
@ -119,7 +119,7 @@ public:
|
||||
if (offset > 0)
|
||||
sink = GatherUtils::sliceFromLeftConstantOffsetUnbounded(*source, static_cast<size_t>(offset - 1));
|
||||
else
|
||||
sink = GatherUtils::sliceFromRightConstantOffsetUnbounded(*source, static_cast<size_t>(-offset));
|
||||
sink = GatherUtils::sliceFromRightConstantOffsetUnbounded(*source, -static_cast<size_t>(offset));
|
||||
}
|
||||
else if (isColumnConst(*length_column))
|
||||
{
|
||||
@ -127,7 +127,7 @@ public:
|
||||
if (offset > 0)
|
||||
sink = GatherUtils::sliceFromLeftConstantOffsetBounded(*source, static_cast<size_t>(offset - 1), length);
|
||||
else
|
||||
sink = GatherUtils::sliceFromRightConstantOffsetBounded(*source, static_cast<size_t>(-offset), length);
|
||||
sink = GatherUtils::sliceFromRightConstantOffsetBounded(*source, -static_cast<size_t>(offset), length);
|
||||
}
|
||||
else
|
||||
sink = GatherUtils::sliceDynamicOffsetBounded(*source, *offset_column, *length_column);
|
||||
|
@ -0,0 +1 @@
|
||||
[0,0,0]
|
1
tests/queries/0_stateless/01664_array_slice_ubsan.sql
Normal file
1
tests/queries/0_stateless/01664_array_slice_ubsan.sql
Normal file
@ -0,0 +1 @@
|
||||
SELECT arraySlice(groupArray(x), -9223372036854775808, NULL) AS y FROM (SELECT '6553.5', uniqState(NULL) AS x FROM numbers(3) GROUP BY number);
|
Loading…
Reference in New Issue
Block a user