提交 a8697c56 编写于 作者: wmmhello's avatar wmmhello

[TD-6167]<fix> optimize sqlobj ref

上级 071ebdc5
...@@ -1782,9 +1782,7 @@ int taos_stmt_set_tbname(TAOS_STMT* stmt, const char* name) { ...@@ -1782,9 +1782,7 @@ int taos_stmt_set_tbname(TAOS_STMT* stmt, const char* name) {
int taos_stmt_close(TAOS_STMT* stmt) { int taos_stmt_close(TAOS_STMT* stmt) {
STscStmt* pStmt = (STscStmt*)stmt; STscStmt* pStmt = (STscStmt*)stmt;
if (pStmt == NULL || pStmt->taos == NULL) { STMT_CHECK
STMT_RET(TSDB_CODE_TSC_DISCONNECTED);
}
if (!pStmt->isInsert) { if (!pStmt->isInsert) {
SNormalStmt* normal = &pStmt->normal; SNormalStmt* normal = &pStmt->normal;
if (normal->params != NULL) { if (normal->params != NULL) {
...@@ -1799,14 +1797,12 @@ int taos_stmt_close(TAOS_STMT* stmt) { ...@@ -1799,14 +1797,12 @@ int taos_stmt_close(TAOS_STMT* stmt) {
if (pStmt->multiTbInsert) { if (pStmt->multiTbInsert) {
taosHashCleanup(pStmt->mtb.pTableHash); taosHashCleanup(pStmt->mtb.pTableHash);
bool rmMeta = false; bool rmMeta = false;
if (pStmt->pSql && pStmt->pSql->res.code != 0) { if (pStmt->pSql->res.code != 0) {
rmMeta = true; rmMeta = true;
} }
tscDestroyDataBlock(pStmt->mtb.lastBlock, rmMeta); tscDestroyDataBlock(pStmt->mtb.lastBlock, rmMeta);
pStmt->mtb.pTableBlockHashList = tscDestroyBlockHashTable(pStmt->mtb.pTableBlockHashList, rmMeta); pStmt->mtb.pTableBlockHashList = tscDestroyBlockHashTable(pStmt->mtb.pTableBlockHashList, rmMeta);
if (pStmt->pSql){ taosHashCleanup(pStmt->pSql->cmd.insertParam.pTableBlockHashList);
taosHashCleanup(pStmt->pSql->cmd.insertParam.pTableBlockHashList);
}
pStmt->pSql->cmd.insertParam.pTableBlockHashList = NULL; pStmt->pSql->cmd.insertParam.pTableBlockHashList = NULL;
taosArrayDestroy(pStmt->mtb.tags); taosArrayDestroy(pStmt->mtb.tags);
tfree(pStmt->mtb.sqlstr); tfree(pStmt->mtb.sqlstr);
...@@ -1985,7 +1981,6 @@ TAOS_RES *taos_stmt_use_result(TAOS_STMT* stmt) { ...@@ -1985,7 +1981,6 @@ TAOS_RES *taos_stmt_use_result(TAOS_STMT* stmt) {
return NULL; return NULL;
} }
TAOS_RES* result = pStmt->pSql; TAOS_RES* result = pStmt->pSql;
pStmt->pSql = NULL;
return result; return result;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册