diff --git a/src/client/src/tscStream.c b/src/client/src/tscStream.c index 1ebef4ce0f..fed9caebbe 100644 --- a/src/client/src/tscStream.c +++ b/src/client/src/tscStream.c @@ -572,6 +572,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p pStream->pSql = pSql; pSql->pStream = pStream; pSql->param = pStream; + pSql->maxRetry = TSDB_MAX_REPLICA; pSql->sqlstr = calloc(1, strlen(sqlstr) + 1); if (pSql->sqlstr == NULL) { @@ -579,6 +580,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p tscFreeSqlObj(pSql); return NULL; } + strtolower(pSql->sqlstr, sqlstr); tscDebugL("%p SQL: %s", pSql, pSql->sqlstr); @@ -619,10 +621,9 @@ void taos_close_stream(TAOS_STREAM *handle) { tscDebug("%p stream:%p is closed", pSql, pStream); // notify CQ to release the pStream object pStream->fp(pStream->param, NULL, NULL); - - taos_free_result(pSql); pStream->pSql = NULL; + taos_free_result(pSql); taosTFree(pStream); } } diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index f9bb180810..e66b361191 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -278,7 +278,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { tscDebug("%p subIndex: %d, no need to launch query, ignore it", pSql, i); tscDestroyJoinSupporter(pSupporter); - tscFreeSqlObj(pPrevSub); + taos_free_result(pPrevSub); pSql->pSubs[i] = NULL; continue; @@ -1383,7 +1383,7 @@ static void doCleanupSubqueries(SSqlObj *pSql, int32_t numOfSubs, SSubqueryState taosTFree(pSupport->localBuffer); taosTFree(pSupport); - tscFreeSqlObj(pSub); + taos_free_result(pSub); } free(pState); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 38fb63f18e..20c3bc2cb6 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1743,8 +1743,6 @@ SSqlObj* createSimpleSubObj(SSqlObj* pSql, void (*fp)(), void* param, int32_t cm } pNew->pTscObj = pSql->pTscObj; - T_REF_INC(pNew->pTscObj); - pNew->signature = pNew; SSqlCmd* pCmd = &pNew->cmd; @@ -1777,7 +1775,6 @@ SSqlObj* createSimpleSubObj(SSqlObj* pSql, void (*fp)(), void* param, int32_t cm tscAddTableMetaInfo(pQueryInfo, pMasterTableMetaInfo->name, NULL, NULL, NULL); T_REF_INC(pNew->pTscObj); - uint64_t p = (uint64_t) pNew; pNew->self = taosCachePut(tscObjCache, &p, sizeof(uint64_t), &pNew, sizeof(uint64_t), 2 * 600 * 1000); return pNew; diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index a35f09cd8d..cb606df692 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1384,6 +1384,9 @@ int32_t mnodeRetrieveShowSuperTables(SShowObj *pShow, char *data, int32_t rows, } pShow->numOfReads += numOfRows; + const int32_t NUM_OF_COLUMNS = 5; + + mnodeVacuumResult(data, NUM_OF_COLUMNS, numOfRows, rows, pShow); mnodeDecDbRef(pDb); return numOfRows; diff --git a/src/util/src/tcache.c b/src/util/src/tcache.c index e1dd521547..a6376e49ad 100644 --- a/src/util/src/tcache.c +++ b/src/util/src/tcache.c @@ -266,7 +266,7 @@ void *taosCacheAcquireByKey(SCacheObj *pCacheObj, const void *key, size_t keyLen if (taosHashGetSize(pCacheObj->pHashTable) == 0) { atomic_add_fetch_32(&pCacheObj->statistics.missCount, 1); - uError("cache:%s, key:%p, not in cache, retrieved failed, reason: empty sqlObj cache", pCacheObj->name, key); + uError("cache:%s, key:%p, not in cache, retrieved failed, reason: empty cache", pCacheObj->name, key); return NULL; }