diff --git a/include/common/tmsg.h b/include/common/tmsg.h index e0dcfbd54442854c991f03510b1e7ba78fc9032b..ee858ad506c91650ad3a7dc0bd3da8f6ad44b81a 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -241,6 +241,7 @@ typedef struct { int32_t schemaLen; // schema length, if length is 0, no schema exists int16_t numOfRows; // total number of rows in current submit block // head of SSubmitBlk + int32_t numOfBlocks; const void* pMsg; } SSubmitMsgIter; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 9c6c532bcd071bf8799e28076a9ea147d5b81443..e7ee164be725465a0368e39d2f7dcfc9a24eb5d9 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -35,6 +35,7 @@ int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) { } pIter->totalLen = htonl(pMsg->length); + pIter->numOfBlocks = htonl(pMsg->numOfBlocks); ASSERT(pIter->totalLen > 0); pIter->len = 0; pIter->pMsg = pMsg; diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 47eaf2d5a5e270cabbb33290682bd9c7f096b5c3..4b0016a746ac04d36b8c87576f11af561bba5203 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -715,8 +715,8 @@ static int vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq, in goto _exit; } - submitRsp.pArray = taosArrayInit(pSubmitReq->numOfBlocks, sizeof(SSubmitBlkRsp)); - newTbUids = taosArrayInit(pSubmitReq->numOfBlocks, sizeof(int64_t)); + submitRsp.pArray = taosArrayInit(msgIter.numOfBlocks, sizeof(SSubmitBlkRsp)); + newTbUids = taosArrayInit(msgIter.numOfBlocks, sizeof(int64_t)); if (!submitRsp.pArray) { pRsp->code = TSDB_CODE_OUT_OF_MEMORY; goto _exit;