diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index e6584f4a00638670cd3098813a128c7f36c51625..e26512d065b97fb5d38ca9d01f48131cbed8513a 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -190,8 +190,9 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, (*pRequest)->body.param = param; STscObj* pTscObj = (*pRequest)->pTscObj; - if (taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, - sizeof((*pRequest)->self))) { + int32_t err = taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, + sizeof((*pRequest)->self)); + if (err) { tscError("%" PRId64 " failed to add to request container, reqId:0x%" PRIx64 ", conn:%" PRId64 ", %s", (*pRequest)->self, (*pRequest)->requestId, pTscObj->id, sql); diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index fe76ba31d7f4e879ba950a4f9b79e36632202b59..ffc357b2e801f0bb51ad59dee2fc57a7cfad17bf 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -769,7 +769,7 @@ static int32_t mndRetrieveQueries(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p } int32_t numOfQueries = taosArrayGetSize(pConn->pQueries); - for (int32_t i = 0; i < numOfQueries; ++i) { + for (int32_t i = 0; i < numOfQueries && numOfRows < rows; ++i) { SQueryDesc *pQuery = taosArrayGet(pConn->pQueries, i); cols = 0;