mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Fix UBSan report in runningDifference
This commit is contained in:
parent
4afcb94a8a
commit
4047542b61
@ -46,7 +46,7 @@ private:
|
|||||||
/// It is possible to track value from previous columns, to calculate continuously across all columnss. Not implemented.
|
/// It is possible to track value from previous columns, to calculate continuously across all columnss. Not implemented.
|
||||||
|
|
||||||
template <typename Src, typename Dst>
|
template <typename Src, typename Dst>
|
||||||
static void process(const PaddedPODArray<Src> & src, PaddedPODArray<Dst> & dst, const NullMap * null_map)
|
static NO_SANITIZE_UNDEFINED void process(const PaddedPODArray<Src> & src, PaddedPODArray<Dst> & dst, const NullMap * null_map)
|
||||||
{
|
{
|
||||||
size_t size = src.size();
|
size_t size = src.size();
|
||||||
dst.resize(size);
|
dst.resize(size);
|
||||||
@ -76,6 +76,7 @@ private:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto cur = src[i];
|
auto cur = src[i];
|
||||||
|
/// Overflow is Ok.
|
||||||
dst[i] = static_cast<Dst>(cur) - prev;
|
dst[i] = static_cast<Dst>(cur) - prev;
|
||||||
prev = cur;
|
prev = cur;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
SELECT k, d, i FROM (SELECT t.1 AS k, t.2 AS v, runningDifference(v) AS d, runningDifference(cityHash64(t.1)) AS i FROM (SELECT arrayJoin([(NULL, 65535), ('a', 7), ('a', 3), ('b', 11), ('b', 2), ('', -9223372036854775808)]) AS t)) WHERE i = 9223372036854775807;
|
Loading…
Reference in New Issue
Block a user