From 384e650882d6660c63e3c3fdb15f86e3dc51e670 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 17 Apr 2024 14:41:47 +0800 Subject: [PATCH] enh: show encryptions --- source/dnode/mnode/impl/src/mndGrant.c | 2 ++ source/libs/nodes/src/nodesUtilFuncs.c | 1 + source/libs/parser/src/parTranslater.c | 10 ++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndGrant.c b/source/dnode/mnode/impl/src/mndGrant.c index 2ec6e09d12..cce386785a 100644 --- a/source/dnode/mnode/impl/src/mndGrant.c +++ b/source/dnode/mnode/impl/src/mndGrant.c @@ -58,6 +58,7 @@ static int32_t mndRetrieveGrant(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl static int32_t mndRetrieveGrantFull(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { return 0; } static int32_t mndRetrieveGrantLogs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { return 0; } static int32_t mndRetrieveMachines(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { return 0; } +static int32_t mndRetrieveEncryptions(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { return 0; } static int32_t mndProcessGrantHB(SRpcMsg *pReq) { return TSDB_CODE_SUCCESS; } @@ -66,6 +67,7 @@ int32_t mndInitGrant(SMnode *pMnode) { mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_GRANTS_FULL, mndRetrieveGrantFull); mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_GRANTS_LOGS, mndRetrieveGrantLogs); mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_MACHINES, mndRetrieveMachines); + mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ENCRYPTIONS, mndRetrieveEncryptions); mndSetMsgHandle(pMnode, TDMT_MND_GRANT_HB_TIMER, mndProcessGrantHB); return 0; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 080a6812c3..9497c44582 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -1201,6 +1201,7 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_SHOW_GRANTS_FULL_STMT: case QUERY_NODE_SHOW_GRANTS_LOGS_STMT: case QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT: + case QUERY_NODE_SHOW_ENCRYPTIONS_STMT: case QUERY_NODE_SHOW_TSMAS_STMT: { SShowStmt* pStmt = (SShowStmt*)pNode; nodesDestroyNode(pStmt->pDbName); diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index c726f10222..53df982212 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -305,10 +305,6 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { { .showType = QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT, .pDbName = TSDB_INFORMATION_SCHEMA_DB, .pTableName = TSDB_INS_TABLE_MACHINES, - }, - { .showType = QUERY_NODE_SHOW_TSMAS_STMT, - .pDbName = TSDB_INFORMATION_SCHEMA_DB, - .pTableName = TSDB_INS_TABLE_TSMAS, .numOfShowCols = 1, .pShowCols = {"*"} }, @@ -318,6 +314,12 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, + { .showType = QUERY_NODE_SHOW_TSMAS_STMT, + .pDbName = TSDB_INFORMATION_SCHEMA_DB, + .pTableName = TSDB_INS_TABLE_TSMAS, + .numOfShowCols = 1, + .pShowCols = {"*"} + }, }; // clang-format on