mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
fixes
This commit is contained in:
parent
467ff74814
commit
363007b964
@ -1847,26 +1847,36 @@ static bool windowDescriptionComparator(const WindowDescription * _left,
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (left[i].column_number < right[i].column_number)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (left[i].direction < right[i].direction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (left[i].nulls_direction < right[i].nulls_direction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (left[i] != right[i])
|
||||
else if (left[i].column_name > right[i].column_name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (left[i].column_number < right[i].column_number)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (left[i].column_number > right[i].column_number)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (left[i].direction < right[i].direction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (left[i].direction > right[i].direction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (left[i].nulls_direction < right[i].nulls_direction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (left[i].nulls_direction > right[i].nulls_direction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(left[i] == right[i]);
|
||||
}
|
||||
|
||||
// Note that we check the length last, because we want to put together the
|
||||
|
@ -798,10 +798,10 @@ void WindowTransform::updateAggregationState()
|
||||
// For now, add the values one by one.
|
||||
auto * columns = ws.argument_columns.data();
|
||||
// Removing arena.get() from the loop makes it faster somehow...
|
||||
auto * _arena = arena.get();
|
||||
auto * arena_ = arena.get();
|
||||
for (auto row = first_row; row < past_the_end_row; ++row)
|
||||
{
|
||||
a->add(buf, columns, row, _arena);
|
||||
a->add(buf, columns, row, arena_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -912,3 +912,11 @@ Expression ((Projection + Before ORDER BY))
|
||||
Expression ((Before window functions + (Projection + Before ORDER BY)))
|
||||
SettingQuotaAndLimits (Set limits and quota after reading from storage)
|
||||
ReadFromStorage (SystemNumbers)
|
||||
-- A test case for the sort comparator found by fuzzer.
|
||||
SELECT
|
||||
max(number) OVER (ORDER BY number DESC NULLS FIRST),
|
||||
max(number) OVER (ORDER BY number ASC NULLS FIRST)
|
||||
FROM numbers(2)
|
||||
;
|
||||
1 0
|
||||
1 1
|
||||
|
@ -308,3 +308,10 @@ from
|
||||
(select number, intDiv(number, 3) p, mod(number, 5) o
|
||||
from numbers(16)) t
|
||||
;
|
||||
|
||||
-- A test case for the sort comparator found by fuzzer.
|
||||
SELECT
|
||||
max(number) OVER (ORDER BY number DESC NULLS FIRST),
|
||||
max(number) OVER (ORDER BY number ASC NULLS FIRST)
|
||||
FROM numbers(2)
|
||||
;
|
||||
|
Loading…
Reference in New Issue
Block a user