diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index b9aaea8469795771854919a2584d28d5c3f4e9e3..b6d46ecbcdc088f63fc08e69306bae6e56886696 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -391,6 +391,7 @@ typedef struct SSqlObj { int32_t retryReason; // previous error code struct SSqlObj *prev, *next; int64_t self; + int32_t rspReceived; } SSqlObj; typedef struct SSqlStream { diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index a6446a49fc8c997207fcbeb9a963e7cf4a1ae227..8fa26f56c9a4707a33cf86a5fc8aab707a21cdf1 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -2772,6 +2772,7 @@ int tscProcessQueryRsp(SSqlObj *pSql) { pRes->data = NULL; tscResetForNextRetrieve(pRes); + pSql->rspReceived = 1; tscDebug("0x%"PRIx64" query rsp received, qId:0x%"PRIx64, pSql->self, pRes->qId); return 0; } diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 018a2964b2711da3fd5f678755a7eebbec205dec..4acf173c9bdef0e222c453794f541ac514a96f56 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1716,7 +1716,7 @@ void tscFetchDatablockForSubquery(SSqlObj* pSql) { STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); if (pRes1->row >= pRes1->numOfRows) { - assert(pSql1->cmd.msgType == TSDB_MSG_TYPE_FETCH); + assert(pSql1->rspReceived == 1); tscDebug("0x%"PRIx64" subquery:0x%"PRIx64" retrieve data from vnode, subquery:%d, vgroupIndex:%d", pSql->self, pSql1->self, pSupporter->subqueryIndex, pTableMetaInfo->vgroupIndex);