1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-3839 Count as window function doesn't work with NULLs'

This commit is contained in:
Jose
2020-04-24 16:05:08 +00:00
parent 658abae818
commit 06312f4a3f

View File

@ -110,7 +110,7 @@ void WF_count<T>::operator()(int64_t b, int64_t e, int64_t c)
e = c; e = c;
// for count(*), the column is optimized out, index[1] does not exist. // for count(*), the column is optimized out, index[1] does not exist.
uint64_t colIn = (fFunctionId == WF__COUNT_ASTERISK) ? 0 : fFieldIndex[1]; int64_t colIn = (fFunctionId == WF__COUNT_ASTERISK) ? 0 : fFieldIndex[1];
for (int64_t i = b; i <= e; i++) for (int64_t i = b; i <= e; i++)
{ {
@ -125,7 +125,7 @@ void WF_count<T>::operator()(int64_t b, int64_t e, int64_t c)
fRow.setData(getPointer(fRowData->at(i))); fRow.setData(getPointer(fRowData->at(i)));
if (fRow.isNullValue(colIn) == true) if (colIn == -1 || fRow.isNullValue(colIn) == true)
continue; continue;
if (fFunctionId != WF__COUNT_DISTINCT) if (fFunctionId != WF__COUNT_DISTINCT)