From d4a9959ef311b2e962ea0894f42a9a35b058b44a Mon Sep 17 00:00:00 2001 From: slguan Date: Mon, 20 Apr 2020 19:22:04 +0800 Subject: [PATCH] [TD-52] change show mnodes meta --- src/mnode/src/mgmtMnode.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mnode/src/mgmtMnode.c b/src/mnode/src/mgmtMnode.c index f1b10c5114..6546b8ea37 100644 --- a/src/mnode/src/mgmtMnode.c +++ b/src/mnode/src/mgmtMnode.c @@ -291,17 +291,17 @@ static int32_t mgmtGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; - pShow->bytes[cols] = 8; - pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP; - strcpy(pSchema[cols].name, "create time"); - pSchema[cols].bytes = htons(pShow->bytes[cols]); - cols++; - pShow->bytes[cols] = 10; pSchema[cols].type = TSDB_DATA_TYPE_BINARY; strcpy(pSchema[cols].name, "role"); pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; + + pShow->bytes[cols] = 8; + pSchema[cols].type = TSDB_DATA_TYPE_TIMESTAMP; + strcpy(pSchema[cols].name, "create time"); + pSchema[cols].bytes = htons(pShow->bytes[cols]); + cols++; pMeta->numOfColumns = htons(cols); pShow->numOfColumns = cols; @@ -347,13 +347,13 @@ static int32_t mgmtRetrieveMnodes(SShowObj *pShow, char *data, int32_t rows, voi cols++; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; - *(int64_t *)pWrite = pMnode->createdTime; + strcpy(pWrite, mgmtGetMnodeRoleStr(pMnode->role)); cols++; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; - strcpy(pWrite, mgmtGetMnodeRoleStr(pMnode->role)); + *(int64_t *)pWrite = pMnode->createdTime; cols++; - + numOfRows++; mgmtReleaseMnode(pMnode); -- GitLab