From 94a3a34f283327dee2165b33cfe82f08ecbd486f Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Tue, 15 Jun 2021 19:16:45 +0800 Subject: [PATCH] add check --- src/client/src/tscSubquery.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 08ade3acc5..4c3af96bbd 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -3154,6 +3154,13 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) { // it is the failure retry insert if (pSql->pSubs != NULL) { + int32_t blockNum = (int32_t)taosArrayGetSize(pCmd->pDataBlocks); + if (pSql->subState.numOfSub != blockNum) { + tscError("0x%"PRIx64" sub num:%d is not same with data block num:%d", pSql->self, pSql->subState.numOfSub, blockNum); + pRes->code = TSDB_CODE_TSC_APP_ERROR; + return pRes->code; + } + for(int32_t i = 0; i < pSql->subState.numOfSub; ++i) { SSqlObj* pSub = pSql->pSubs[i]; SInsertSupporter* pSup = calloc(1, sizeof(SInsertSupporter)); -- GitLab