mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Fix crash in largestTriangleThreeBuckets
This commit is contained in:
parent
e3c09e9703
commit
0474beceab
@ -40,12 +40,16 @@ struct LargestTriangleThreeBucketsData : public StatisticalSample<Float64, Float
|
||||
{
|
||||
void add(const Float64 xval, const Float64 yval, Arena * arena)
|
||||
{
|
||||
/// We need to ensure either both or neither coordinates are saved (StatisticalSample ignores NaNs)
|
||||
if (isNaN(xval) || isNaN(yval))
|
||||
return;
|
||||
this->addX(xval, arena);
|
||||
this->addY(yval, arena);
|
||||
}
|
||||
|
||||
void sort(Arena * arena)
|
||||
{
|
||||
chassert(this->x.size() == this->y.size());
|
||||
// sort the this->x and this->y in ascending order of this->x using index
|
||||
std::vector<size_t> index(this->x.size());
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
[]
|
@ -0,0 +1 @@
|
||||
SELECT largestTriangleThreeBuckets(1)(1, nan);
|
Loading…
Reference in New Issue
Block a user