diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 3d3e7295b9faef9899fc608df179b01c83ffada0..f8119b0d4ad07ea235f8e098149a8703a416427e 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4743,7 +4743,11 @@ static FORCE_INLINE void setEnvForEachBlock(SQInfo* pQInfo, STableQueryInfo* pTa } if (QUERY_IS_INTERVAL_QUERY(pQuery)) { - setIntervalQueryRange(pQInfo, pBlockInfo->window.skey); + if (!QUERY_IS_ASC_QUERY(pRuntimeEnv->pQuery)) { + setIntervalQueryRange(pQInfo, pBlockInfo->window.ekey); + } else { + setIntervalQueryRange(pQInfo, pBlockInfo->window.skey); + } } else { // non-interval query setExecutionContext(pQInfo, pTableQueryInfo->groupIndex, pBlockInfo->window.ekey + step); }