Skip to content

Commit

Permalink
Merge pull request #18876 from taosdata/fix/showQueriesCrash
Browse files Browse the repository at this point in the history
fix: show queries crash issue
  • Loading branch information
guanshengliang authored Dec 10, 2022
2 parents c6bce3f + 1aff3cc commit ac389db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions source/client/src/clientImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion source/dnode/mnode/impl/src/mndProfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ac389db

Please sign in to comment.