1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-15 03:21:42 +03:00

MCOL-1793 Handle transition of Window Frame from outside of Partition to inside

This commit is contained in:
David Hall
2018-11-06 10:48:37 -06:00
parent 1426b4d99b
commit df6d97ca04

View File

@ -194,23 +194,26 @@ void WindowFunction::operator()()
// Built-in functions may have this functionality added in the future.
// If b > e then the frame is entirely outside of the partition
// and there's no values to drop
if (!firstTime && b <= e)
if (b <= e)
{
if (fFunctionType->dropValues(prevFrame.first, w.first))
if (!firstTime)
{
// Adjust the beginning of the frame for nextValue
// to start where the previous frame left off.
b = prevFrame.second + 1;
}
else
{
// dropValues failed or doesn't exist
// so calculate the entire frame.
fFunctionType->resetData();
if (fFunctionType->dropValues(prevFrame.first, w.first))
{
// Adjust the beginning of the frame for nextValue
// to start where the previous frame left off.
b = prevFrame.second + 1;
}
else
{
// dropValues failed or doesn't exist
// so calculate the entire frame.
fFunctionType->resetData();
}
}
firstTime = false;
}
fFunctionType->operator()(b, e, i); // UDAnF: Calls nextValue and evaluate
firstTime = false;
prevFrame = w;
}
}