From b73b7754250a7923d5e477e9016c5bf5c8d1f300 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 11 Jun 2020 14:58:38 +0800 Subject: [PATCH] [td-225] fix previous generated sql object --- src/client/src/tscServer.c | 2 -- src/client/src/tscSubquery.c | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 3fb22f7f8d..4e20e57499 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -2220,9 +2220,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) { if (pTableMetaInfo->pTableMeta) { bool isSuperTable = UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo); - taosCacheRelease(tscCacheHandle, (void **)&(pTableMetaInfo->pTableMeta), true); -// taosCacheRelease(tscCacheHandle, (void **)&(pTableMetaInfo->pMetricMeta), true); if (isSuperTable) { // if it is a super table, reset whole query cache tscTrace("%p reset query cache since table:%s is stable", pSql, pTableMetaInfo->name); diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index ddc41e52e5..3bc931a855 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1662,12 +1662,13 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { */ if (code != TSDB_CODE_SUCCESS) { if (trsupport->numOfRetry++ >= MAX_NUM_OF_SUBQUERY_RETRY) { - tscTrace("%p sub:%p reach the max retry times, set global code:%d", pParentSql, pSql, code); + tscTrace("%p sub:%p reach the max retry times, set global code:%s", pParentSql, pSql, tstrerror(code)); atomic_val_compare_exchange_32(&pState->code, 0, code); } else { // does not reach the maximum retry time, go on tscTrace("%p sub:%p failed code:%s, retry:%d", pParentSql, pSql, tstrerror(code), trsupport->numOfRetry); SSqlObj *pNew = tscCreateSqlObjForSubquery(pParentSql, trsupport, pSql); + if (pNew == NULL) { tscError("%p sub:%p failed to create new subquery due to out of memory, abort retry, vgId:%d, orderOfSub:%d", trsupport->pParentSqlObj, pSql, pVgroup->vgId, trsupport->subqueryIndex); @@ -1677,7 +1678,8 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { } else { SQueryInfo *pNewQueryInfo = tscGetQueryInfoDetail(&pNew->cmd, 0); assert(pNewQueryInfo->pTableMetaInfo[0]->pTableMeta != NULL); - + + taos_free_result(pSql); tscProcessSql(pNew); return; } -- GitLab