diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 0ab830bf70447582f6fa8edf4d4befcac8506731..fb7174d9881547366621074cdfd4bbf6b8744413 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -419,13 +419,11 @@ int tscProcessSql(SSqlObj *pSql) { type = pQueryInfo->type; // while numOfTables equals to 0, it must be Heartbeat - assert((pQueryInfo->numOfTables == 0 && pQueryInfo->command == TSDB_SQL_HB) || - pQueryInfo->numOfTables > 0); + assert((pQueryInfo->numOfTables == 0 && pQueryInfo->command == TSDB_SQL_HB) || pQueryInfo->numOfTables > 0); } tscTrace("%p SQL cmd:%d will be processed, name:%s, type:%d", pSql, pCmd->command, name, type); - if (pSql->cmd.command < TSDB_SQL_MGMT) { - // the pTableMetaInfo cannot be NULL + if (pSql->cmd.command < TSDB_SQL_MGMT) { // the pTableMetaInfo cannot be NULL if (pTableMetaInfo == NULL) { pSql->res.code = TSDB_CODE_OTHERS; return pSql->res.code; diff --git a/src/query/inc/qresultBuf.h b/src/query/inc/qresultBuf.h index ebea29feda257fa3da71407138fd657005336521..2e813dbd98417eda0411d469653c8a1573b4be38 100644 --- a/src/query/inc/qresultBuf.h +++ b/src/query/inc/qresultBuf.h @@ -103,7 +103,7 @@ int32_t getNumOfResultBufGroupId(SDiskbasedResultBuf* pResultBuf); * destroy result buffer * @param pResultBuf */ -void destroyResultBuf(SDiskbasedResultBuf* pResultBuf); +void destroyResultBuf(SDiskbasedResultBuf* pResultBuf, void* handle); /** * diff --git a/src/query/src/qresultBuf.c b/src/query/src/qresultBuf.c index d9a3c6a0bf2f4a4e03b18e226c03f2005f0c3e82..bdf700c83f3fa7d69ab83dcb273939b001524cd6 100644 --- a/src/query/src/qresultBuf.c +++ b/src/query/src/qresultBuf.c @@ -191,7 +191,7 @@ SIDList getDataBufPagesIdList(SDiskbasedResultBuf* pResultBuf, int32_t groupId) } } -void destroyResultBuf(SDiskbasedResultBuf* pResultBuf) { +void destroyResultBuf(SDiskbasedResultBuf* pResultBuf, void* handle) { if (pResultBuf == NULL) { return; } @@ -200,7 +200,7 @@ void destroyResultBuf(SDiskbasedResultBuf* pResultBuf) { close(pResultBuf->fd); } - qTrace("disk-based output buffer closed, %" PRId64 " bytes, file:%s", pResultBuf->totalBufSize, pResultBuf->path); + qTrace("QInfo:%p disk-based output buffer closed, %" PRId64 " bytes, file:%s", handle, pResultBuf->totalBufSize, pResultBuf->path); munmap(pResultBuf->pBuf, pResultBuf->totalBufSize); unlink(pResultBuf->path); diff --git a/src/query/src/queryExecutor.c b/src/query/src/queryExecutor.c index 5b8b70594436233fd6922fcca06257a0780b7e08..a3ffb20952e51efae3ca9fc1dc8cb95a94b50538 100644 --- a/src/query/src/queryExecutor.c +++ b/src/query/src/queryExecutor.c @@ -1500,8 +1500,9 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) { } SQuery *pQuery = pRuntimeEnv->pQuery; - - qTrace("QInfo:%p teardown runtime env", GET_QINFO_ADDR(pRuntimeEnv)); + SQInfo* pQInfo = (SQInfo*) GET_QINFO_ADDR(pRuntimeEnv); + + qTrace("QInfo:%p teardown runtime env", pQInfo); cleanupTimeWindowInfo(&pRuntimeEnv->windowResInfo, pQuery->numOfOutput); if (pRuntimeEnv->pCtx != NULL) { @@ -1531,7 +1532,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) { tfree(pRuntimeEnv->pInterpoBuf); } - destroyResultBuf(pRuntimeEnv->pResultBuf); + destroyResultBuf(pRuntimeEnv->pResultBuf, pQInfo); tsdbCleanupQueryHandle(pRuntimeEnv->pQueryHandle); tsdbCleanupQueryHandle(pRuntimeEnv->pSecQueryHandle);