You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-1793 Window functions return garbage if current row outside of window frame.
This commit is contained in:
@ -481,6 +481,7 @@ bool WF_udaf::dropValues(int64_t b, int64_t e)
|
||||
}
|
||||
}
|
||||
|
||||
WindowFunctionType::resetData();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -708,6 +709,12 @@ void WF_udaf::operator()(int64_t b, int64_t e, int64_t c)
|
||||
uint64_t colOut = fFieldIndex[0];
|
||||
bool isNull = false;
|
||||
|
||||
// Initialize result to NULL. If no values are found, NULL is the result.
|
||||
// if (getContext().getRunFlag(mcsv1sdk::UDAF_DEFAULT_NULL))
|
||||
// {
|
||||
// getNullValueAny(fValOut, getContext().getResultType(), getContext().getColWidth());
|
||||
// }
|
||||
|
||||
if ((fFrameUnit == WF__FRAME_ROWS) ||
|
||||
(fPrev == -1) ||
|
||||
(!fPeer->operator()(getPointer(fRowData->at(c)), getPointer(fRowData->at(fPrev)))))
|
||||
|
@ -188,7 +188,7 @@ void WindowFunction::operator()()
|
||||
}
|
||||
|
||||
// If b > e then the frame is entirely outside of the partition
|
||||
// and there's no values to add
|
||||
// and there's no values to drop
|
||||
if (b <= e)
|
||||
{
|
||||
// UDAnF functions may have a dropValue function implemented.
|
||||
@ -207,15 +207,15 @@ void WindowFunction::operator()()
|
||||
}
|
||||
else
|
||||
{
|
||||
// dropValues failed so do the entire frame.
|
||||
// dropValues failed or doesn't exist
|
||||
// so do the entire frame.
|
||||
fFunctionType->resetData();
|
||||
}
|
||||
}
|
||||
|
||||
fFunctionType->operator()(b, e, i); // Calls nextValue
|
||||
}
|
||||
prevFrame = w;
|
||||
fFunctionType->operator()(b, e, i); // UDAnF: Calls nextValue and evaluate
|
||||
firstTime = false;
|
||||
prevFrame = w;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user