fix: bind single column memory issue

This commit is contained in:
dapan1121 2022-12-02 09:34:43 +08:00
parent af9aba51a5
commit a704abe9e6
2 changed files with 7 additions and 3 deletions

View File

@ -764,7 +764,7 @@ int stmtAddBatch(TAOS_STMT* stmt) {
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_ADD_BATCH));
STMT_ERR_RET(stmtCacheBlock(pStmt));
//STMT_ERR_RET(stmtCacheBlock(pStmt));
return TSDB_CODE_SUCCESS;
}

View File

@ -178,6 +178,8 @@ int32_t qBindStmtColsValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, in
tColDataAddValueByBind(pCol, bind + c);
}
qDebug("stmt all %d columns bind %d rows data", boundInfo->numOfBound, rowNum);
return TSDB_CODE_SUCCESS;
}
@ -190,16 +192,18 @@ int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBu
SSchema* pColSchema = &pSchema[boundInfo->pColIndex[colIdx]];
SColData* pCol = taosArrayGet(pDataBlock->pData->aCol, colIdx);
if (bind[colIdx].num != rowNum) {
if (bind->num != rowNum) {
return buildInvalidOperationMsg(&pBuf, "row number in each bind param should be the same");
}
if (bind[colIdx].buffer_type != pColSchema->type) {
if (bind->buffer_type != pColSchema->type) {
return buildInvalidOperationMsg(&pBuf, "column type mis-match with buffer type");
}
tColDataAddValueByBind(pCol, bind);
qDebug("stmt col %d bind %d rows data", colIdx, rowNum);
return TSDB_CODE_SUCCESS;
}