未验证 提交 3ca45394 编写于 作者: wafwerar's avatar wafwerar 提交者: GitHub

Merge pull request #11488 from taosdata/fix/ZhiqiangWang/TD-13254-fix-show-grants

fix(grant): show grants.
...@@ -14,12 +14,13 @@ ...@@ -14,12 +14,13 @@
*/ */
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#ifndef _GRANT
#include "os.h" #include "os.h"
#include "taoserror.h" #include "taoserror.h"
#include "mndGrant.h" #include "mndGrant.h"
#include "mndInt.h" #include "mndInt.h"
#ifndef _GRANT
int32_t mndInitGrant(SMnode *pMnode) { return TSDB_CODE_SUCCESS; } int32_t mndInitGrant(SMnode *pMnode) { return TSDB_CODE_SUCCESS; }
void mndCleanupGrant() {} void mndCleanupGrant() {}
void grantParseParameter() { mError("can't parsed parameter k"); } void grantParseParameter() { mError("can't parsed parameter k"); }
...@@ -30,4 +31,4 @@ void grantRestore(EGrantType grant, uint64_t value) {} ...@@ -30,4 +31,4 @@ void grantRestore(EGrantType grant, uint64_t value) {}
#endif #endif
void parseGrantParameter() { parseGrantParameter(); } void parseGrantParameter() { grantParseParameter(); }
\ No newline at end of file \ No newline at end of file
...@@ -652,24 +652,26 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pB ...@@ -652,24 +652,26 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pB
if (pShow->pIter == NULL) break; if (pShow->pIter == NULL) break;
cols = 0; cols = 0;
SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
char name[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0}; char name[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0};
STR_WITH_MAXSIZE_TO_VARSTR(name, pUser->user, pShow->bytes[cols]); STR_WITH_MAXSIZE_TO_VARSTR(name, pUser->user, pShow->bytes[cols]);
colDataAppend(pColInfo, numOfRows, (const char*) name, false); colDataAppend(pColInfo, numOfRows, (const char*) name, false);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); cols++;
pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
const char* src = pUser->superUser? "super":"normal"; const char* src = pUser->superUser? "super":"normal";
char b[10+VARSTR_HEADER_SIZE] = {0}; char b[10+VARSTR_HEADER_SIZE] = {0};
STR_WITH_SIZE_TO_VARSTR(b, src, strlen(src)); STR_WITH_SIZE_TO_VARSTR(b, src, strlen(src));
colDataAppend(pColInfo, numOfRows, (const char*) b, false); colDataAppend(pColInfo, numOfRows, (const char*) b, false);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); cols++;
pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
colDataAppend(pColInfo, numOfRows, (const char*) &pUser->createdTime, false); colDataAppend(pColInfo, numOfRows, (const char*) &pUser->createdTime, false);
cols++;
pColInfo = taosArrayGet(pBlock->pDataBlock, cols); pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
STR_WITH_MAXSIZE_TO_VARSTR(name, pUser->acct, pShow->bytes[cols]); STR_WITH_MAXSIZE_TO_VARSTR(name, pUser->acct, pShow->bytes[cols]);
colDataAppend(pColInfo, numOfRows, (const char*) name, false); colDataAppend(pColInfo, numOfRows, (const char*) name, false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册