Merge branch 'refact/submit_req' of https://github.com/taosdata/TDengine into refact/submit_req

This commit is contained in:
Hongze Cheng 2022-12-06 20:49:32 +08:00
commit 648e3f6512
1 changed files with 12 additions and 0 deletions

View File

@ -1153,6 +1153,16 @@ static int32_t parseValueToken(SInsertParseContext* pCxt, const char** pSql, STo
return code;
}
static void clearColValArray(SArray* pCols) {
int32_t num = taosArrayGetSize(pCols);
for (int32_t i = 0; i < num; ++i) {
SColVal* pCol = taosArrayGet(pCols, i);
if (TSDB_DATA_TYPE_NCHAR == pCol->type) {
taosMemoryFreeClear(pCol->value.pData);
}
}
}
static int parseOneRow(SInsertParseContext* pCxt, const char** pSql, STableDataCxt* pTableCxt, bool* pGotRow,
SToken* pToken) {
SBoundColInfo* pCols = &pTableCxt->boundColsInfo;
@ -1206,6 +1216,8 @@ static int parseOneRow(SInsertParseContext* pCxt, const char** pSql, STableDataC
*pGotRow = true;
}
clearColValArray(pTableCxt->pValues);
return code;
}