提交 c4136b1b 编写于 作者: Y yihaoDeng

[TD-6131]<fix> show vnodes crash

上级 121e0bc0
......@@ -274,6 +274,7 @@ typedef struct {
int32_t rowSize;
int32_t numOfRows;
void * pIter;
void * pVgIter;
void ** ppShow;
int16_t offset[TSDB_MAX_COLUMNS];
int32_t bytes[TSDB_MAX_COLUMNS];
......
......@@ -1232,13 +1232,12 @@ static int32_t mnodeRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, vo
pDnode = (SDnodeObj *)(pShow->pIter);
if (pDnode != NULL) {
void *pIter = NULL;
SVgObj *pVgroup;
while (1) {
pIter = mnodeGetNextVgroup(pIter, &pVgroup);
pShow->pVgIter = mnodeGetNextVgroup(pShow->pVgIter, &pVgroup);
if (pVgroup == NULL) break;
for (int32_t i = pShow->index; i < pVgroup->numOfVnodes && numOfRows < rows; ++i) {
for (int32_t i = 0; i < pVgroup->numOfVnodes && numOfRows < rows; ++i) {
SVnodeGid *pVgid = &pVgroup->vnodeGid[i];
if (pVgid->pDnode == pDnode) {
cols = 0;
......@@ -1251,8 +1250,8 @@ static int32_t mnodeRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, vo
STR_TO_VARSTR(pWrite, syncRole[pVgid->role]);
cols++;
numOfRows++;
}
pShow->index = i;
}
if (numOfRows >= rows) {
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册