Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
a3302ef0
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a3302ef0
编写于
2月 09, 2020
作者:
T
tianbin1001
提交者:
GitHub
2月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grant visitor optimize (#4214)
上级
1994e188
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
9 deletion
+9
-9
shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DCLStatement.g4
...arser-mysql/src/main/antlr4/imports/mysql/DCLStatement.g4
+5
-5
shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
...he/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
+4
-4
未找到文件。
shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DCLStatement.g4
浏览文件 @
a3302ef0
...
...
@@ -20,18 +20,18 @@ grammar DCLStatement;
import Symbol, Keyword, MySQLKeyword, Literals, BaseRule;
grant
: GRANT (proxyClause_ | privilegeClause
_
| roleClause_)
: GRANT (proxyClause_ | privilegeClause | roleClause_)
;
revoke
: REVOKE (proxyClause_ | privilegeClause
_
| allClause_ | roleClause_)
: REVOKE (proxyClause_ | privilegeClause | allClause_ | roleClause_)
;
proxyClause_
: PROXY ON userOrRole TO userOrRoles_ withGrantOption_?
;
privilegeClause
_
privilegeClause
: privileges_ ON onObjectClause_ (TO | FROM) userOrRoles_ withGrantOption_? grantOption_?
;
...
...
@@ -94,14 +94,14 @@ privilegeType_
;
onObjectClause_
: objectType_? privilegeLevel
_
: objectType_? privilegeLevel
;
objectType_
: TABLE | FUNCTION | PROCEDURE
;
privilegeLevel
_
privilegeLevel
: ASTERISK_ | ASTERISK_ DOT_ASTERISK_ | identifier DOT_ASTERISK_ | tableName
;
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
浏览文件 @
a3302ef0
...
...
@@ -24,8 +24,8 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateU
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropRoleContext
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropUserContext
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.GrantContext
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.PrivilegeClause
_
Context
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.PrivilegeLevel
_
Context
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.PrivilegeClauseContext
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.PrivilegeLevelContext
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.RenameUserContext
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SetDefaultRoleContext
;
import
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SetPasswordContext
;
...
...
@@ -93,9 +93,9 @@ public final class MySQLDCLVisitor extends MySQLVisitor {
@Override
public
ASTNode
visitGrant
(
final
GrantContext
ctx
)
{
GrantStatement
result
=
new
GrantStatement
();
PrivilegeClause
_Context
privilegeClause
=
ctx
.
privilegeClause_
();
PrivilegeClause
Context
privilegeClause
=
ctx
.
privilegeClause
();
if
(
null
!=
privilegeClause
&&
null
!=
privilegeClause
.
onObjectClause_
())
{
PrivilegeLevel
_Context
privilegeLevel
=
privilegeClause
.
onObjectClause_
().
privilegeLevel_
();
PrivilegeLevel
Context
privilegeLevel
=
privilegeClause
.
onObjectClause_
().
privilegeLevel
();
TableNameContext
tableNameContext
=
privilegeLevel
.
tableName
();
if
(
null
!=
tableNameContext
)
{
TableSegment
tableSegment
=
(
TableSegment
)
visitTableName
(
tableNameContext
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录