Fix UBSAN in largestTriangleThreeBuckets

This commit is contained in:
flynn 2024-12-12 11:32:20 +00:00
parent d93dff37f3
commit 5213617a9e
3 changed files with 4 additions and 1 deletions

View File

@ -329,7 +329,7 @@ public:
return [](IColumn & column, Float64 value)
{
auto & col = assert_cast<ColumnDateTime64 &>(column);
col.getData().push_back(static_cast<UInt64>(value));
col.getData().push_back(static_cast<Int64>(value));
};
default:
return [](IColumn & column, Float64 value)

View File

@ -15,3 +15,4 @@
(9978,978) 9978 10
(9988,988) 9988 10
(9999,999) 9999 11
[(0,'1900-01-01 00:00:00.000')]

View File

@ -61,4 +61,6 @@ SELECT
point_x - neighbor(point_x, -1) AS point_x_diff_with_previous_row
FROM largestTriangleTreeBucketsBucketSizeTest LIMIT 990, 10;
SELECT largestTriangleThreeBuckets(1)(0, '1900-01-01 00:00:00'::DateTime64);
DROP TABLE largestTriangleTreeBucketsBucketSizeTest;