diff --git a/src/system/detail/src/mgmtDb.c b/src/system/detail/src/mgmtDb.c index b935b68425e053a1a4ed466d65c8c790c701f384..6b0792a3088f938f585aa7eb94daca140c3bde23 100644 --- a/src/system/detail/src/mgmtDb.c +++ b/src/system/detail/src/mgmtDb.c @@ -664,6 +664,21 @@ int mgmtRetrieveDbs(SShowObj *pShow, char *data, int rows, SConnObj *pConn) { 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;