From fbb76bb9b216a8414520c0ecc3db1327152923f4 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 14 Sep 2020 15:54:46 +0800 Subject: [PATCH] [td-1319] --- src/client/src/tscSql.c | 34 ++++++++++++++++------------------ src/client/src/tscUtil.c | 4 ++-- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 025f0a2b14..f02e587455 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -265,22 +265,22 @@ void taos_close(TAOS *taos) { } // free all sqlObjs created by using this connect before free the STscObj - while(1) { - pthread_mutex_lock(&pObj->mutex); - void* p = pObj->sqlList; - pthread_mutex_unlock(&pObj->mutex); - - if (p == NULL) { - break; - } - - tscDebug("%p waiting for sqlObj to be freed, %p", pObj, p); - taosMsleep(100); - - // todo fix me!! two threads call taos_free_result will cause problem. - tscDebug("%p free :%p", pObj, p); - taos_free_result(p); - } +// while(1) { +// pthread_mutex_lock(&pObj->mutex); +// void* p = pObj->sqlList; +// pthread_mutex_unlock(&pObj->mutex); +// +// if (p == NULL) { +// break; +// } +// +// tscDebug("%p waiting for sqlObj to be freed, %p", pObj, p); +// taosMsleep(100); +// +// // todo fix me!! two threads call taos_free_result will cause problem. +// tscDebug("%p free :%p", pObj, p); +// taos_free_result(p); +// } int32_t ref = T_REF_DEC(pObj); assert(ref >= 0); @@ -605,8 +605,6 @@ void taos_free_result(TAOS_RES *res) { return; } -// assert(pSql->self != 0 && *pSql->self == pSql); - bool freeNow = tscKillQueryInDnode(pSql); if (freeNow) { tscDebug("%p free sqlObj in cache", pSql); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 7f2c1716a6..979e153356 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -366,7 +366,7 @@ void tscPartiallyFreeSqlObj(SSqlObj* pSql) { tscResetSqlCmdObj(pCmd, false); } -static void tscFreeSubobj(SSqlObj* pSql) { +static UNUSED_FUNC void tscFreeSubobj(SSqlObj* pSql) { if (pSql->numOfSubs == 0) { return; } @@ -438,7 +438,7 @@ void tscFreeSqlObj(SSqlObj* pSql) { tscDebug("%p start to free sqlObj", pSql); STscObj* pTscObj = pSql->pTscObj; - tscFreeSubobj(pSql); +// tscFreeSubobj(pSql); tscPartiallyFreeSqlObj(pSql); pSql->signature = NULL;