From d5abee89dde1bef4d3ff20dcfdc4966bc8154ab2 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 27 Aug 2020 15:04:19 +0800 Subject: [PATCH] [td-255] fix compiler error --- src/client/src/tscSubquery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index eaae026f06..011940a0e6 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1911,6 +1911,9 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) { size_t size = taosArrayGetSize(pCmd->pDataBlocks); assert(size > 0); + // the number of already initialized subqueries + int32_t numOfSub = 0; + pSql->numOfSubs = (uint16_t)size; pSql->pSubs = calloc(size, POINTER_BYTES); if (pSql->pSubs == NULL) { @@ -1924,7 +1927,6 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) { pState->numOfRemain = pSql->numOfSubs; pRes->code = TSDB_CODE_SUCCESS; - int32_t numOfSub = 0; while(numOfSub < pSql->numOfSubs) { SInsertSupporter* pSupporter = calloc(1, sizeof(SInsertSupporter)); -- GitLab