diff --git a/utils/windowfunction/wf_count.cpp b/utils/windowfunction/wf_count.cpp index 8bcded90c..1e18c6a74 100644 --- a/utils/windowfunction/wf_count.cpp +++ b/utils/windowfunction/wf_count.cpp @@ -125,24 +125,22 @@ void WF_count::operator()(int64_t b, int64_t e, int64_t c) if (!isNull) { // constant, set fCount to row count - fCount = e - b + 1; + fCount += e - b + 1; } } } + else if (fFunctionId == WF__COUNT_ASTERISK) + { + // count(*), set fCount to row count + fCount += e - b + 1; + } else { - for (int64_t i = b; i <= e; i++) { if (i % 1000 == 0 && fStep->cancelled()) break; - if (fFunctionId == WF__COUNT_ASTERISK) - { - fCount++; - continue; - } - fRow.setData(getPointer(fRowData->at(i))); if (fRow.isNullValue(colIn) == true)