diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 47a5e1522f7438e632c40f34e854f5b38493d7ae..a994f815f9fbb6c142071107a5f16b75cf2f1971 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -1410,7 +1410,9 @@ static void rowwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis *pS item->lastKey = (QUERY_IS_ASC_QUERY(pQuery)? pDataBlockInfo->window.ekey:pDataBlockInfo->window.skey) + step; } - item->cur = tsBufGetCursor(pRuntimeEnv->pTSBuf); + if (pRuntimeEnv->pTSBuf != NULL) { + item->cur = tsBufGetCursor(pRuntimeEnv->pTSBuf); + } // todo refactor: extract method for(int32_t i = 0; i < pQuery->numOfOutput; ++i) {