You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/02/06 12:42:56 UTC

[GitHub] [incubator-shardingsphere] tianbin1001 opened a new pull request #4190: Add mysql grant visitor for DCLStatement

tianbin1001 opened a new pull request #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190
 
 
   Add mysql grant visitor for DCLStatement

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190#discussion_r376293310
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
 ##########
 @@ -82,4 +89,21 @@ public ASTNode visitRenameUser(final RenameUserContext ctx) {
     public ASTNode visitSetPassword(final SetPasswordContext ctx) {
         return new SetPasswordStatement();
     }
+
+    @Override
+    public ASTNode visitGrant(final GrantContext ctx) {
+        GrantStatement result = new GrantStatement();
+        PrivilegeClause_Context privilegeClause = ctx.privilegeClause_();
+        if (null != privilegeClause && null != privilegeClause.onObjectClause_()) {
+            PrivilegeLevel_Context privilegeLevel = privilegeClause.onObjectClause_().privilegeLevel_();
 
 Review comment:
   `PrivilegeLevel_Context` is visited, so please rename `PrivilegeLevel_` to `PrivilegeLevel`. Notice: replace this key word all of our project.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] codecov-io commented on issue #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190#issuecomment-583319729
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-shardingsphere/pull/4190?src=pr&el=h1) Report
   > :exclamation: No coverage uploaded for pull request base (`master@d75f0c1`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-shardingsphere/pull/4190/graphs/tree.svg?width=650&token=ZvlXpWa7so&height=150&src=pr)](https://codecov.io/gh/apache/incubator-shardingsphere/pull/4190?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff            @@
   ##             master   #4190   +/-   ##
   ========================================
     Coverage          ?   60.8%           
     Complexity        ?     352           
   ========================================
     Files             ?    1012           
     Lines             ?   16937           
     Branches          ?    2983           
   ========================================
     Hits              ?   10298           
     Misses            ?    5987           
     Partials          ?     652
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-shardingsphere/pull/4190?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...dingsphere/sql/parser/visitor/MySQLDCLVisitor.java](https://codecov.io/gh/apache/incubator-shardingsphere/pull/4190/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLW15c3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zcWwvcGFyc2VyL3Zpc2l0b3IvTXlTUUxEQ0xWaXNpdG9yLmphdmE=) | `0% <0%> (ø)` | `0 <0> (?)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shardingsphere/pull/4190?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-shardingsphere/pull/4190?src=pr&el=footer). Last update [d75f0c1...1eb8a41](https://codecov.io/gh/apache/incubator-shardingsphere/pull/4190?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190#discussion_r376194678
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
 ##########
 @@ -82,4 +92,34 @@ public ASTNode visitRenameUser(final RenameUserContext ctx) {
     public ASTNode visitSetPassword(final SetPasswordContext ctx) {
         return new SetPasswordStatement();
     }
+
+    @Override
+    public ASTNode visitGrant(final GrantContext ctx) {
+        GrantStatement result = new GrantStatement();
+        PrivilegeClause_Context privilegeClause = ctx.privilegeClause_();
+        if (null != privilegeClause && null != privilegeClause.onObjectClause_()) {
+            PrivilegeLevel_Context privilegeLevel = privilegeClause.onObjectClause_().privilegeLevel_();
+            TableNameContext tableNameContext = privilegeLevel.tableName();
+            if (null != tableNameContext) {
+                TableSegment tableSegment = createTableSegment(tableNameContext);
 
 Review comment:
   It it better to change it to `visit(tableNameContext)` which will call `visitTableName(final TableNameContext ctx)` in `MySQLVisitor.java`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190#discussion_r376294792
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
 ##########
 @@ -82,4 +89,21 @@ public ASTNode visitRenameUser(final RenameUserContext ctx) {
     public ASTNode visitSetPassword(final SetPasswordContext ctx) {
         return new SetPasswordStatement();
     }
+
+    @Override
+    public ASTNode visitGrant(final GrantContext ctx) {
+        GrantStatement result = new GrantStatement();
+        PrivilegeClause_Context privilegeClause = ctx.privilegeClause_();
+        if (null != privilegeClause && null != privilegeClause.onObjectClause_()) {
 
 Review comment:
   if (true), it is better to overwrite `visitOnObjectClause_()` and move the content of `if condition` to the new function. Don't you think so?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] coveralls edited a comment on issue #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on issue #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190#issuecomment-582924391
 
 
   ## Pull Request Test Coverage Report for [Build 9365](https://coveralls.io/builds/28586057)
   
   * **0** of **11**   **(0.0%)**  changed or added relevant lines in **1** file are covered.
   * **106** unchanged lines in **2** files lost coverage.
   * Overall coverage decreased (**-0.05%**) to **64.71%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java](https://coveralls.io/builds/28586057/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fvisitor%2FMySQLDCLVisitor.java#L95) | 0 | 11 | 0.0%
   <!-- | **Total:** | **0** | **11** | **0.0%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/util/IpUtils.java](https://coveralls.io/builds/28586057/source?filename=sharding-orchestration%2Fsharding-orchestration-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Finternal%2Futil%2FIpUtils.java#L65) | 3 | 76.0% |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java](https://coveralls.io/builds/28586057/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FMySQLVisitor.java#L107) | 103 | 0% |
   <!-- | **Total:** | **106** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/28586057/badge)](https://coveralls.io/builds/28586057) |
   | :-- | --: |
   | Change from base [Build 785](https://coveralls.io/builds/28565931): |  -0.05% |
   | Covered Lines: | 10960 |
   | Relevant Lines: | 16937 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero merged pull request #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tianbin1001 commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
tianbin1001 commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190#discussion_r376271759
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
 ##########
 @@ -82,4 +92,34 @@ public ASTNode visitRenameUser(final RenameUserContext ctx) {
     public ASTNode visitSetPassword(final SetPasswordContext ctx) {
         return new SetPasswordStatement();
     }
+
+    @Override
+    public ASTNode visitGrant(final GrantContext ctx) {
+        GrantStatement result = new GrantStatement();
+        PrivilegeClause_Context privilegeClause = ctx.privilegeClause_();
+        if (null != privilegeClause && null != privilegeClause.onObjectClause_()) {
+            PrivilegeLevel_Context privilegeLevel = privilegeClause.onObjectClause_().privilegeLevel_();
+            TableNameContext tableNameContext = privilegeLevel.tableName();
+            if (null != tableNameContext) {
+                TableSegment tableSegment = createTableSegment(tableNameContext);
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] coveralls commented on issue #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
coveralls commented on issue #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190#issuecomment-582924391
 
 
   ## Pull Request Test Coverage Report for [Build 9348](https://coveralls.io/builds/28567283)
   
   * **0** of **19**   **(0.0%)**  changed or added relevant lines in **1** file are covered.
   * **3** unchanged lines in **1** file lost coverage.
   * Overall coverage decreased (**-0.08%**) to **64.684%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java](https://coveralls.io/builds/28567283/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fvisitor%2FMySQLDCLVisitor.java#L98) | 0 | 19 | 0.0%
   <!-- | **Total:** | **0** | **19** | **0.0%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/util/IpUtils.java](https://coveralls.io/builds/28567283/source?filename=sharding-orchestration%2Fsharding-orchestration-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Finternal%2Futil%2FIpUtils.java#L65) | 3 | 76.0% |
   <!-- | **Total:** | **3** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/28567283/badge)](https://coveralls.io/builds/28567283) |
   | :-- | --: |
   | Change from base [Build 785](https://coveralls.io/builds/28565931): |  -0.08% |
   | Covered Lines: | 10960 |
   | Relevant Lines: | 16944 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tianbin1001 commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement

Posted by GitBox <gi...@apache.org>.
tianbin1001 commented on a change in pull request #4190: Add mysql grant visitor for DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4190#discussion_r376768395
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/MySQLDCLVisitor.java
 ##########
 @@ -82,4 +89,21 @@ public ASTNode visitRenameUser(final RenameUserContext ctx) {
     public ASTNode visitSetPassword(final SetPasswordContext ctx) {
         return new SetPasswordStatement();
     }
+
+    @Override
+    public ASTNode visitGrant(final GrantContext ctx) {
+        GrantStatement result = new GrantStatement();
+        PrivilegeClause_Context privilegeClause = ctx.privilegeClause_();
+        if (null != privilegeClause && null != privilegeClause.onObjectClause_()) {
+            PrivilegeLevel_Context privilegeLevel = privilegeClause.onObjectClause_().privilegeLevel_();
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services