feat: sql command 'grant', 'revoke', 'kill transaction' and 'show transactions'
This commit is contained in:
parent
6e50691b29
commit
bfaceda030
|
@ -412,6 +412,11 @@ static int32_t mndProcessAlterUserReq(SNodeMsg *pReq) {
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TSDB_ALTER_USER_PASSWD == alterReq.alterType && alterReq.pass[0] == 0) {
|
||||||
|
terrno = TSDB_CODE_MND_INVALID_PASS_FORMAT;
|
||||||
|
goto _OVER;
|
||||||
|
}
|
||||||
|
|
||||||
pUser = mndAcquireUser(pMnode, alterReq.user);
|
pUser = mndAcquireUser(pMnode, alterReq.user);
|
||||||
if (pUser == NULL) {
|
if (pUser == NULL) {
|
||||||
terrno = TSDB_CODE_MND_USER_NOT_EXIST;
|
terrno = TSDB_CODE_MND_USER_NOT_EXIST;
|
||||||
|
|
|
@ -52,9 +52,18 @@ static int32_t authSelect(SAuthCxt* pCxt, SSelectStmt* pSelect) {
|
||||||
return pCxt->errCode;
|
return pCxt->errCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32_t authSetOperator(SAuthCxt* pCxt, SSetOperator* pSetOper) {
|
||||||
|
int32_t code = authQuery(pCxt, pSetOper->pLeft);
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = authQuery(pCxt, pSetOper->pRight);
|
||||||
|
}
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) {
|
static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) {
|
||||||
switch (nodeType(pStmt)) {
|
switch (nodeType(pStmt)) {
|
||||||
case QUERY_NODE_SET_OPERATOR:
|
case QUERY_NODE_SET_OPERATOR:
|
||||||
|
return authSetOperator(pCxt, (SSetOperator*)pStmt);
|
||||||
case QUERY_NODE_SELECT_STMT:
|
case QUERY_NODE_SELECT_STMT:
|
||||||
return authSelect(pCxt, (SSelectStmt*)pStmt);
|
return authSelect(pCxt, (SSelectStmt*)pStmt);
|
||||||
case QUERY_NODE_VNODE_MODIF_STMT:
|
case QUERY_NODE_VNODE_MODIF_STMT:
|
||||||
|
|
|
@ -181,6 +181,12 @@ int32_t __catalogGetDBCfg(SCatalog* pCtg, void* pRpc, const SEpSet* pMgmtEps, co
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t __catalogChkAuth(SCatalog* pCtg, void* pRpc, const SEpSet* pMgmtEps, const char* user, const char* dbFName,
|
||||||
|
AUTH_TYPE type, bool* pass) {
|
||||||
|
*pass = true;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void initMetaDataEnv() {
|
void initMetaDataEnv() {
|
||||||
mockCatalogService.reset(new MockCatalogService());
|
mockCatalogService.reset(new MockCatalogService());
|
||||||
|
|
||||||
|
@ -193,6 +199,7 @@ void initMetaDataEnv() {
|
||||||
stub.set(catalogGetDBVgVersion, __catalogGetDBVgVersion);
|
stub.set(catalogGetDBVgVersion, __catalogGetDBVgVersion);
|
||||||
stub.set(catalogGetDBVgInfo, __catalogGetDBVgInfo);
|
stub.set(catalogGetDBVgInfo, __catalogGetDBVgInfo);
|
||||||
stub.set(catalogGetDBCfg, __catalogGetDBCfg);
|
stub.set(catalogGetDBCfg, __catalogGetDBCfg);
|
||||||
|
stub.set(catalogChkAuth, __catalogChkAuth);
|
||||||
// {
|
// {
|
||||||
// AddrAny any("libcatalog.so");
|
// AddrAny any("libcatalog.so");
|
||||||
// std::map<std::string,void*> result;
|
// std::map<std::string,void*> result;
|
||||||
|
|
Loading…
Reference in New Issue