Merge pull request #65689 from Algunenano/max_intersections_crash

Fix crash in maxIntersections
This commit is contained in:
Raúl Marín 2024-06-26 10:18:37 +00:00 committed by GitHub
commit 9f3433199b
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;