You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-4171 Some fixes
This commit is contained in:
committed by
Roman Nozdrin
parent
5b8aba0005
commit
af80081c94
@ -215,23 +215,10 @@ void WF_nth_value<T>::operator()(int64_t b, int64_t e, int64_t c)
|
||||
if (!fNthNull)
|
||||
{
|
||||
implicit2T(idx, tmp, 0);
|
||||
|
||||
if (tmp <= 0)
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << tmp;
|
||||
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_ARG_OUT_OF_RANGE,
|
||||
oss.str()), ERR_WF_ARG_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
if (tmp > e) // prevent integer overflow
|
||||
tmp = e + 1;
|
||||
|
||||
fNth = (int64_t) tmp;
|
||||
fNth = round(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool isNull = true;
|
||||
|
||||
if ((!fNthNull) && ((b + fNth - 1) <= e))
|
||||
@ -256,7 +243,7 @@ void WF_nth_value<T>::operator()(int64_t b, int64_t e, int64_t c)
|
||||
|
||||
int64_t n = k + fNth - 1;
|
||||
|
||||
if (n <= e)
|
||||
if (n <= e && n >= 0)
|
||||
{
|
||||
fRow.setData(getPointer(fRowData->at(n)));
|
||||
getValue(colIn, fValue);
|
||||
|
Reference in New Issue
Block a user