diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index be4d849fb99e1f030f48f08e43e7407cd3676451..e9957b0f0d6fe2f74b0e7064726cec2e61771e04 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -1667,7 +1667,7 @@ static void rowwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis *pS _end: assert(offset >= 0 && tsCols != NULL); - if (prevTs != INT64_MIN) { + if (prevTs != INT64_MIN && prevTs != *(int64_t*)pRuntimeEnv->prevRow[0]) { assert(prevRowIndex >= 0); item->lastKey = prevTs + step; } @@ -7715,4 +7715,4 @@ void** qReleaseQInfo(void* pMgmt, void* pQInfo, bool freeHandle) { taosCacheRelease(pQueryMgmt->qinfoPool, pQInfo, freeHandle); return 0; -} \ No newline at end of file +}