diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 557d38d7f108606e387dca6c85fd1938e0a97905..b04db7ca1de4ae107ad0ce5570b095882d8698c5 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -1304,7 +1304,8 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul j++; } - for(; pResultRowInfo->pResult[j] != pResultRowInfo->current; ++j) { + SResultRow* current = pResultRowInfo->current; + for(; pResultRowInfo->pResult[j] != current && j < pResultRowInfo->size; ++j) { SResultRow* pRes = pResultRowInfo->pResult[j]; if (pRes->closed) { assert(resultRowInterpolated(pRes, RESULT_ROW_START_INTERP) && resultRowInterpolated(pRes, RESULT_ROW_END_INTERP));