fix/release iter
This commit is contained in:
parent
46877cab5e
commit
c8252ad5f3
|
@ -2326,9 +2326,10 @@ static int32_t mndShowTransAction(SShowObj *pShow, SSDataBlock *pBlock, STransAc
|
||||||
char detail[TSDB_TRANS_DETAIL_LEN] = {0};
|
char detail[TSDB_TRANS_DETAIL_LEN] = {0};
|
||||||
len = 0;
|
len = 0;
|
||||||
char bufStart[40] = {0};
|
char bufStart[40] = {0};
|
||||||
taosFormatUtcTime(bufStart, sizeof(bufStart), pAction->startTime, TSDB_TIME_PRECISION_MILLI);
|
if (pAction->startTime > 0)
|
||||||
|
taosFormatUtcTime(bufStart, sizeof(bufStart), pAction->startTime, TSDB_TIME_PRECISION_MILLI);
|
||||||
char bufEnd[40] = {0};
|
char bufEnd[40] = {0};
|
||||||
taosFormatUtcTime(bufEnd, sizeof(bufEnd), pAction->endTime, TSDB_TIME_PRECISION_MILLI);
|
if (pAction->endTime > 0) taosFormatUtcTime(bufEnd, sizeof(bufEnd), pAction->endTime, TSDB_TIME_PRECISION_MILLI);
|
||||||
len += snprintf(detail + len, sizeof(detail) - len, "startTime:%s, endTime:%s, ", bufStart, bufEnd);
|
len += snprintf(detail + len, sizeof(detail) - len, "startTime:%s, endTime:%s, ", bufStart, bufEnd);
|
||||||
char detailVStr[TSDB_TRANS_DETAIL_LEN + VARSTR_HEADER_SIZE] = {0};
|
char detailVStr[TSDB_TRANS_DETAIL_LEN + VARSTR_HEADER_SIZE] = {0};
|
||||||
STR_WITH_MAXSIZE_TO_VARSTR(detailVStr, detail, pShow->pMeta->pSchemas[cols].bytes);
|
STR_WITH_MAXSIZE_TO_VARSTR(detailVStr, detail, pShow->pMeta->pSchemas[cols].bytes);
|
||||||
|
@ -2438,7 +2439,7 @@ static int32_t mndRetrieveTransDetail(SRpcMsg *pReq, SShowObj *pShow, SSDataBloc
|
||||||
pShow->pIter);
|
pShow->pIter);
|
||||||
|
|
||||||
if (pShow->pIter == NULL) {
|
if (pShow->pIter == NULL) {
|
||||||
pShow->pIter = taosMemoryMalloc(sizeof(STransDetailIter)); // TODO dmchen
|
pShow->pIter = taosMemoryMalloc(sizeof(STransDetailIter));
|
||||||
if (pShow->pIter == NULL) {
|
if (pShow->pIter == NULL) {
|
||||||
mError("failed to malloc for pShow->pIter");
|
mError("failed to malloc for pShow->pIter");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2478,6 +2479,10 @@ _OVER:
|
||||||
} else {
|
} else {
|
||||||
mInfo("retrieve trans detail, numOfRows:%d, pShow->numOfRows:%d", numOfRows, pShow->numOfRows)
|
mInfo("retrieve trans detail, numOfRows:%d, pShow->numOfRows:%d", numOfRows, pShow->numOfRows)
|
||||||
}
|
}
|
||||||
|
if (numOfRows == 0) {
|
||||||
|
taosMemoryFree(pShow->pIter);
|
||||||
|
pShow->pIter = NULL;
|
||||||
|
}
|
||||||
return numOfRows;
|
return numOfRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue