From 5ff1dbe5f3ab140704aa60697fe19c3b3d2aced2 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 14 Sep 2020 21:41:42 +0800 Subject: [PATCH] [td-1391]add free subobj --- src/client/src/tscSubquery.c | 2 -- src/client/src/tscUtil.c | 35 +---------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 8d908b2506..e9ec272ea4 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1903,9 +1903,7 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows) pParentObj->res.code = pSql->res.code; } - taos_free_result(tres); taosTFree(pSupporter); - if (atomic_sub_fetch_32(&pState->numOfRemain, 1) > 0) { return; } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 979e153356..f06d36e0c6 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -382,39 +382,6 @@ static UNUSED_FUNC void tscFreeSubobj(SSqlObj* pSql) { pSql->numOfSubs = 0; } -//static UNUSED_FUNC bool tscKillQueryInDnode(SSqlObj* pSql) { -// SSqlCmd* pCmd = &pSql->cmd; -// SSqlRes* pRes = &pSql->res; -// -// if (pRes == NULL || pRes->qhandle == 0) { -// return true; -// } -// -// SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); -// if ((pQueryInfo == NULL) || tscIsTwoStageSTableQuery(pQueryInfo, 0)) { -// return true; -// } -// -// STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); -// tscRemoveFromSqlList(pSql); -// -// int32_t cmd = pCmd->command; -// if (pRes->code == TSDB_CODE_SUCCESS && pRes->completed == false && pSql->pStream == NULL && (pTableMetaInfo->pTableMeta != NULL) && -// (cmd == TSDB_SQL_SELECT || -// cmd == TSDB_SQL_SHOW || -// cmd == TSDB_SQL_RETRIEVE || -// cmd == TSDB_SQL_FETCH)) { -// pQueryInfo->type = TSDB_QUERY_TYPE_FREE_RESOURCE; -// pCmd->command = (pCmd->command > TSDB_SQL_MGMT) ? TSDB_SQL_RETRIEVE : TSDB_SQL_FETCH; -// tscDebug("%p send msg to dnode to free qhandle ASAP before free sqlObj, command:%s, ", pSql, sqlCmd[pCmd->command]); -// -// tscProcessSql(pSql); -// return false; -// } -// -// return true; -//} - /** * The free operation will cause the pSql to be removed from hash table and free it in * the function of processmsgfromserver is impossible in this case, since it will fail @@ -438,7 +405,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; -- GitLab