From 5c819f2534d278c1b6013f5f822087b0f5b9cd5b Mon Sep 17 00:00:00 2001 From: dengyihao Date: Tue, 9 Jun 2020 17:23:49 +0800 Subject: [PATCH 1/2] optimized code --- src/client/src/tscAsync.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 23071fccfa..c61402192d 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -449,14 +449,13 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { tscTrace("%p update table meta in local cache, continue to process sql and send corresponding subquery", pSql); STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); - if (pTableMetaInfo->pTableMeta == NULL){ - code = tscGetTableMeta(pSql, pTableMetaInfo); - if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { - return; - } else { - assert(code == TSDB_CODE_SUCCESS); - } + code = tscGetTableMeta(pSql, pTableMetaInfo); + if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { + return; + } else { + assert(code == TSDB_CODE_SUCCESS); } + assert((tscGetNumOfTags(pTableMetaInfo->pTableMeta) != 0) && pTableMetaInfo->vgroupIndex >= 0 && pSql->param != NULL); From 7e55813961d2727d9018bd02a33e1a8c3f2ad1c4 Mon Sep 17 00:00:00 2001 From: dengyihao Date: Tue, 9 Jun 2020 17:54:17 +0800 Subject: [PATCH 2/2] optimized code --- src/client/src/tscUtil.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 215b544639..2701d2b572 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -396,14 +396,12 @@ void tscPartiallyFreeSqlObj(SSqlObj* pSql) { if (pObj->signature == pObj) { pthread_mutex_lock(&pObj->mutex); tfree(pSql->sqlstr); - pSql->sqlstr = NULL; pthread_mutex_unlock(&pObj->mutex); } tscFreeSqlResult(pSql); tfree(pSql->pSubs); - pSql->pSubs = NULL; pSql->freed = 0; pSql->numOfSubs = 0;