From 2918faf142fff79c97d4e1f36e4b8d3be8db42e2 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Wed, 12 Oct 2022 10:51:37 +0800 Subject: [PATCH] fix: release the local meta cache of each sql --- src/client/src/tscServer.c | 2 +- src/client/src/tscUtil.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 8cc28bb2ca..b7459b00da 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -3393,7 +3393,7 @@ int tscRenewTableMeta(SSqlObj *pSql) { SSqlCmd* pCmd2 = &pSql->rootObj->cmd; SHashObj *pmap = pCmd2->pTableMetaMap; if (pmap == atomic_val_compare_exchange_ptr(&pCmd2->pTableMetaMap, pmap, NULL)) { - tscCleanupTableMetaMap(pCmd2->pTableMetaMap); + tscCleanupTableMetaMap(pmap); } pCmd2->pTableMetaMap = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 766e3e340f..6e29d6ddc3 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1653,7 +1653,7 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool clearCachedMeta, uint64_t id) { tscFreeQueryInfo(pCmd, clearCachedMeta, id); SHashObj *pmap = pCmd->pTableMetaMap; if (pmap == atomic_val_compare_exchange_ptr(&pCmd->pTableMetaMap, pmap, NULL)) { - tscCleanupTableMetaMap(pCmd->pTableMetaMap); + tscCleanupTableMetaMap(pmap); } taosReleaseRef(tscObjRef, id); } -- GitLab