[TD-225] release the ref if insertion succeeds.

This commit is contained in:
Haojun Liao 2020-12-12 18:37:48 +08:00
parent 102c3989c4
commit 9363f414d6
1 changed files with 5 additions and 1 deletions

View File

@ -405,8 +405,12 @@ void tscResetSqlCmdObj(SSqlCmd* pCmd, bool removeFromCache) {
pCmd->msgType = 0; pCmd->msgType = 0;
pCmd->parseFinished = 0; pCmd->parseFinished = 0;
pCmd->autoCreated = 0; pCmd->autoCreated = 0;
pCmd->numOfTables = 0;
for(int32_t i = 0; i < pCmd->numOfTables; ++i) {
taosCacheRelease(tscMetaCache, (void**)&(pCmd->pTableMetaList[i]), false);
}
pCmd->numOfTables = 0;
tfree(pCmd->pTableMetaList); tfree(pCmd->pTableMetaList);
pCmd->pTableBlockHashList = tscDestroyBlockHashTable(pCmd->pTableBlockHashList); pCmd->pTableBlockHashList = tscDestroyBlockHashTable(pCmd->pTableBlockHashList);