Merge pull request #4685 from taosdata/bugfix/td-2538
[TD-2538]<fix>: crash when sql has limit & offset
This commit is contained in:
commit
87b3f29206
|
@ -911,6 +911,13 @@ static void genFinalResWithoutFill(SSqlRes* pRes, SLocalReducer *pLocalReducer,
|
|||
}
|
||||
}
|
||||
|
||||
if (pRes->numOfRowsGroup >= pQueryInfo->limit.limit && pQueryInfo->limit.limit > 0) {
|
||||
pRes->numOfRows = 0;
|
||||
pBeforeFillData->num = 0;
|
||||
pLocalReducer->discard = true;
|
||||
return;
|
||||
}
|
||||
|
||||
pRes->numOfRowsGroup += pRes->numOfRows;
|
||||
|
||||
// impose the limitation of output rows on the final result
|
||||
|
|
Loading…
Reference in New Issue