fix(query): fix tail function points larger than total rows issue

This commit is contained in:
Ganlin Zhao 2022-05-16 17:02:01 +08:00
parent 21b5f72340
commit a281da1379
1 changed files with 1 additions and 0 deletions

View File

@ -3236,6 +3236,7 @@ int32_t tailFunction(SqlFunctionCtx* pCtx) {
SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput;
int32_t startOffset = pCtx->offset;
pInfo->numOfPoints = MIN(pInfo->numOfPoints, pInput->numOfRows);
for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; i += 1) {
char* data = colDataGetData(pInputCol, i);