fix(stmt2/settbtags): fix memleak & can not set tags issue
This commit is contained in:
parent
987e086918
commit
d50c72d2f4
|
@ -194,6 +194,12 @@ static int32_t stmtUpdateBindInfo(TAOS_STMT2* stmt, STableMeta* pTableMeta, void
|
||||||
pStmt->bInfo.tbSuid = pTableMeta->suid;
|
pStmt->bInfo.tbSuid = pTableMeta->suid;
|
||||||
pStmt->bInfo.tbVgId = pTableMeta->vgId;
|
pStmt->bInfo.tbVgId = pTableMeta->vgId;
|
||||||
pStmt->bInfo.tbType = pTableMeta->tableType;
|
pStmt->bInfo.tbType = pTableMeta->tableType;
|
||||||
|
|
||||||
|
if (!pStmt->bInfo.tagsCached) {
|
||||||
|
qDestroyBoundColInfo(pStmt->bInfo.boundTags);
|
||||||
|
taosMemoryFreeClear(pStmt->bInfo.boundTags);
|
||||||
|
}
|
||||||
|
|
||||||
pStmt->bInfo.boundTags = tags;
|
pStmt->bInfo.boundTags = tags;
|
||||||
pStmt->bInfo.tagsCached = false;
|
pStmt->bInfo.tagsCached = false;
|
||||||
tstrncpy(pStmt->bInfo.stbFName, sTableName, sizeof(pStmt->bInfo.stbFName));
|
tstrncpy(pStmt->bInfo.stbFName, sTableName, sizeof(pStmt->bInfo.stbFName));
|
||||||
|
@ -984,10 +990,6 @@ int stmtSetTbTags2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* tags) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pStmt->bInfo.inExecCache) {
|
|
||||||
return TSDB_CODE_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
STableDataCxt** pDataBlock =
|
STableDataCxt** pDataBlock =
|
||||||
(STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
(STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
|
||||||
if (NULL == pDataBlock) {
|
if (NULL == pDataBlock) {
|
||||||
|
@ -995,6 +997,10 @@ int stmtSetTbTags2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* tags) {
|
||||||
STMT_ERR_RET(TSDB_CODE_APP_ERROR);
|
STMT_ERR_RET(TSDB_CODE_APP_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pStmt->bInfo.inExecCache && (!pStmt->sql.autoCreateTbl || (*pDataBlock)->pData->pCreateTbReq)) {
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
tscDebug("start to bind stmt tag values");
|
tscDebug("start to bind stmt tag values");
|
||||||
STMT_ERR_RET(qBindStmtTagsValue2(*pDataBlock, pStmt->bInfo.boundTags, pStmt->bInfo.tbSuid, pStmt->bInfo.stbFName,
|
STMT_ERR_RET(qBindStmtTagsValue2(*pDataBlock, pStmt->bInfo.boundTags, pStmt->bInfo.tbSuid, pStmt->bInfo.stbFName,
|
||||||
pStmt->bInfo.sname.tname, tags, pStmt->exec.pRequest->msgBuf,
|
pStmt->bInfo.sname.tname, tags, pStmt->exec.pRequest->msgBuf,
|
||||||
|
|
Loading…
Reference in New Issue