Merge pull request #65714 from ClickHouse/backport/24.6/65689

Backport #65689 to 24.6: Fix crash in maxIntersections
This commit is contained in:
Raúl Marín 2024-06-27 13:25:50 +02:00 committed by GitHub
commit c417c2df68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

View File

@ -91,7 +91,8 @@ public:
return std::make_shared<DataTypeNumber<PointType>>();
}
bool allocatesMemoryInArena() const override { return false; }
/// MaxIntersectionsData::Allocator uses the arena
bool allocatesMemoryInArena() const override { return true; }
void add(AggregateDataPtr __restrict place, const IColumn ** columns, size_t row_num, Arena * arena) const override
{

View File

@ -0,0 +1,8 @@
1 3 3
1 6 3
2 5 3
3 7 3
1 3 2
1 6 2
2 5 2
3 7 2

View File

@ -0,0 +1,5 @@
DROP TABLE IF EXISTS my_events;
CREATE TABLE my_events (start UInt32, end UInt32) Engine = MergeTree ORDER BY tuple()
AS Select * FROM VALUES ('start UInt32, end UInt32', (1, 3), (1, 6), (2, 5), (3, 7));
SELECT start, end, maxIntersections(start, end) OVER () FROM my_events;
SELECT start, end, maxIntersectionsPosition(start, end) OVER () FROM my_events;