未验证 提交 c72802f1 编写于 作者: H haojun Liao 提交者: GitHub

Merge pull request #1294 from taosdata/master-lihui

[#1293 The result of show databases for no root user]
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册