diff --git a/include/common/tdataformat.h b/include/common/tdataformat.h index 537f559e90..313d1963fd 100644 --- a/include/common/tdataformat.h +++ b/include/common/tdataformat.h @@ -131,7 +131,6 @@ int32_t tValueCompare(const SValue *tv1, const SValue *tv2); int32_t tRowBuild(SArray *aColVal, const STSchema *pTSchema, SRow **ppRow); int32_t tRowGet(SRow *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal); void tRowDestroy(SRow *pRow); -void tRowDataClear(SRow *pColData); int32_t tRowSort(SArray *aRowP); int32_t tRowMerge(SArray *aRowP, STSchema *pTSchema, int8_t flag); int32_t tRowUpsertColData(SRow *pRow, STSchema *pTSchema, SColData *aColData, int32_t nColData, int32_t flag); diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index df92ea6dfd..6c50dbba81 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -1430,7 +1430,7 @@ int stmtBindBatch2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* bind, int32_t colIdx) { pStmt->taos->optionInfo.charsetCxt); } else { taosArrayDestroy(pCols); - (*pDataBlock)->pData->aCol = taosArrayInit(bind->num, POINTER_BYTES); + (*pDataBlock)->pData->aCol = taosArrayInit(20, POINTER_BYTES); code = qBindStmtColsValue2(*pDataBlock, (*pDataBlock)->pData->aRowP, bind, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen, &pStmt->sql.siInfo.pTSchema, pStmt->sql.pBindInfo, pStmt->taos->optionInfo.charsetCxt); diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index 730f861bcf..f9deb2fcbf 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -669,15 +669,6 @@ void tRowDestroy(SRow *pRow) { if (pRow) taosMemoryFree(pRow); } -void tRowDataClear(SRow *pColData) { - pColData->ts = 0; - pColData->len = 0; - pColData->sver = 0; - pColData->flag = 0; - pColData->numOfPKs = 0; -} - - static int32_t tRowPCmprFn(const void *p1, const void *p2) { SRowKey key1, key2; tRowGetKey(*(SRow **)p1, &key1); diff --git a/source/libs/parser/src/parInsertStmt.c b/source/libs/parser/src/parInsertStmt.c index 91dea5742a..0a4025ccac 100644 --- a/source/libs/parser/src/parInsertStmt.c +++ b/source/libs/parser/src/parInsertStmt.c @@ -58,8 +58,7 @@ int32_t qCloneCurrentTbData(STableDataCxt* pDataBlock, SSubmitTbData** pData) { SColData* pCol = (SColData*)taosArrayGet(pNew->aCol, i); tColDataDeepClear(pCol); } else { - SRow* pRowp = (SRow*)taosArrayGet(pNew->aCol, i); - tRowDataClear(pRowp); + pNew->aCol = taosArrayInit(20, POINTER_BYTES); } } @@ -1174,12 +1173,7 @@ int32_t qResetStmtDataBlock(STableDataCxt* block, bool deepClear) { tColDataClear(pCol); } } else { - SRow* aRowP = (SRow*)taosArrayGet(pBlock->pData->aRowP, i); - if (aRowP == NULL) { - qError("qResetStmtDataBlock row pointer is NULL"); - return terrno; - } - tRowDataClear(aRowP); + pBlock->pData->aRowP = taosArrayInit(20, POINTER_BYTES); } }