From 388cf10e91cc965331e0dde8c4b0d1a6543829f3 Mon Sep 17 00:00:00 2001 From: lihui Date: Mon, 2 Mar 2020 14:17:25 +0800 Subject: [PATCH] [#1293] --- src/system/detail/src/mgmtDb.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/system/detail/src/mgmtDb.c b/src/system/detail/src/mgmtDb.c index b935b68425..3317435d01 100644 --- a/src/system/detail/src/mgmtDb.c +++ b/src/system/detail/src/mgmtDb.c @@ -663,7 +663,22 @@ int mgmtRetrieveDbs(SShowObj *pShow, char *data, int rows, SConnObj *pConn) { SDbObj *pDb = NULL; char * pWrite; int cols = 0; - + + void* pNext = pShow->pNode; + while (numOfRows < rows) { + pDb = (SDbObj *)pNext; + if (pDb == NULL) break; + pNext = (void *)pDb->next; + if (mgmtCheckIsMonitorDB(pDb->name, tsMonitorDbName)) { + if (strcmp(pConn->pUser->user, "root") != 0 && strcmp(pConn->pUser->user, "_root") != 0 && strcmp(pConn->pUser->user, "monitor") != 0 ) { + rows--; + break; + } + } + numOfRows++; + } + + numOfRows = 0; while (numOfRows < rows) { pDb = (SDbObj *)pShow->pNode; if (pDb == NULL) break; -- GitLab