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/02 05:44:07 UTC

[GitHub] [incubator-shardingsphere] beijing-penguin opened a new pull request #4138: add antlr visitor for MySQL DCLStatement

beijing-penguin opened a new pull request #4138: add antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138
 
 
   Changes proposed in this pull request:
   - add drop_role and set_default_role.
   - update role file MySQLStatement.
   

----------------------------------------------------------------
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] beijing-penguin commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
beijing-penguin commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373826629
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/MySQLStatement.g4
 ##########
 @@ -45,6 +45,7 @@ execute
     | renameUser
     | createRole
     | dropRole
+    | setDefaultRole
 
 Review comment:
   > Which rule g4 file does it exist?
   
   DCLStatement.g4

----------------------------------------------------------------
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] SteNicholas commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373826621
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/visitor/dcl/set_default_role.xml
 ##########
 @@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-parser-test-cases>
+    <common sql-case-id="set_none_role" />
 
 Review comment:
   Similar to above.

----------------------------------------------------------------
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] beijing-penguin commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
beijing-penguin commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373828125
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java
 ##########
 @@ -26,6 +26,7 @@
 import org.antlr.v4.runtime.tree.TerminalNode;
 import org.apache.shardingsphere.sql.parser.api.SQLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementBaseVisitor;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.*;
 
 Review comment:
   ok,update!

----------------------------------------------------------------
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 issue #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#issuecomment-581270403
 
 
   /ci

----------------------------------------------------------------
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 #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373825605
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/MySQLStatement.g4
 ##########
 @@ -45,6 +45,7 @@ execute
     | renameUser
     | createRole
     | dropRole
+    | setDefaultRole
 
 Review comment:
   Which rule g4 file does it exist?

----------------------------------------------------------------
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 #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
coveralls commented on issue #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#issuecomment-581417974
 
 
   ## Pull Request Test Coverage Report for [Build 9300](https://coveralls.io/builds/28496661)
   
   * **0** of **2**   **(0.0%)**  changed or added relevant lines in **1** file are covered.
   * **276** unchanged lines in **7** files lost coverage.
   * Overall coverage decreased (**-0.009%**) to **65.165%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java](https://coveralls.io/builds/28496661/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FMySQLVisitor.java#L263) | 0 | 2 | 0.0%
   <!-- | **Total:** | **0** | **2** | **0.0%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/registry/config/listener/SchemaChangedListener.java](https://coveralls.io/builds/28496661/source?filename=sharding-orchestration%2Fsharding-orchestration-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Finternal%2Fregistry%2Fconfig%2Flistener%2FSchemaChangedListener.java#L112) | 1 | 97.5% |
   | [sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/registry/config/service/ConfigurationService.java](https://coveralls.io/builds/28496661/source?filename=sharding-orchestration%2Fsharding-orchestration-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Finternal%2Fregistry%2Fconfig%2Fservice%2FConfigurationService.java#L182) | 1 | 98.39% |
   | [sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/util/IpUtils.java](https://coveralls.io/builds/28496661/source?filename=sharding-orchestration%2Fsharding-orchestration-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Finternal%2Futil%2FIpUtils.java#L65) | 3 | 76.0% |
   | [sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/api/yaml/YamlShardingDataSourceFactory.java](https://coveralls.io/builds/28496661/source?filename=sharding-jdbc%2Fsharding-jdbc-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fshardingjdbc%2Fapi%2Fyaml%2FYamlShardingDataSourceFactory.java#L52) | 4 | 0% |
   | [sharding-jdbc/sharding-jdbc-orchestration/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/api/yaml/YamlOrchestrationShardingDataSourceFactory.java](https://coveralls.io/builds/28496661/source?filename=sharding-jdbc%2Fsharding-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fshardingjdbc%2Forchestration%2Fapi%2Fyaml%2FYamlOrchestrationShardingDataSourceFactory.java#L90) | 4 | 64.71% |
   | [shardingsphere-underlying/shardingsphere-common/src/main/java/org/apache/shardingsphere/underlying/common/yaml/engine/YamlEngine.java](https://coveralls.io/builds/28496661/source?filename=shardingsphere-underlying%2Fshardingsphere-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Funderlying%2Fcommon%2Fyaml%2Fengine%2FYamlEngine.java#L72) | 15 | 0% |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java](https://coveralls.io/builds/28496661/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FMySQLVisitor.java#L215) | 248 | 0% |
   <!-- | **Total:** | **276** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/28496661/badge)](https://coveralls.io/builds/28496661) |
   | :-- | --: |
   | Change from base [Build 761](https://coveralls.io/builds/28490024): |  -0.009% |
   | Covered Lines: | 10919 |
   | Relevant Lines: | 16756 |
   
   ---
   ##### 💛  - [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 #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138
 
 
   

----------------------------------------------------------------
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] beijing-penguin commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
beijing-penguin commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373935416
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java
 ##########
 @@ -249,7 +250,17 @@ public ASTNode visitShowLike(final ShowLikeContext ctx) {
     public ASTNode visitCreateUser(final CreateUserContext ctx) {
         return new DCLStatement();
     }
-
+    
+    @Override
+    public ASTNode visitDropRole(DropRoleContext ctx) {
+        return new DCLStatement();
+    }
+    
+    @Override
+    public ASTNode visitSetDefaultRole(SetDefaultRoleContext ctx) {
 
 Review comment:
   setDefaultRole have add to sql-statement-rule-definition.xml,please review again

----------------------------------------------------------------
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] SteNicholas commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373826534
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java
 ##########
 @@ -26,6 +26,7 @@
 import org.antlr.v4.runtime.tree.TerminalNode;
 import org.apache.shardingsphere.sql.parser.api.SQLVisitor;
 import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementBaseVisitor;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.*;
 
 Review comment:
   Please don't use * for import. Check the code style.

----------------------------------------------------------------
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 #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373825553
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java
 ##########
 @@ -249,7 +250,17 @@ public ASTNode visitShowLike(final ShowLikeContext ctx) {
     public ASTNode visitCreateUser(final CreateUserContext ctx) {
         return new DCLStatement();
     }
-
+    
+    @Override
+    public ASTNode visitDropRole(DropRoleContext ctx) {
+        return new DCLStatement();
+    }
+    
+    @Override
+    public ASTNode visitSetDefaultRole(SetDefaultRoleContext ctx) {
 
 Review comment:
   Is it necessary to add? I could find this one in `META-INF/parsing-rule-definition/mysql/sql-statement-rule-definition.xml`

----------------------------------------------------------------
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] beijing-penguin commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
beijing-penguin commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373828987
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/visitor/dcl/drop_role.xml
 ##########
 @@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-parser-test-cases>
+    <common sql-case-id="drop_role" />
 
 Review comment:
   run test unit is ok

----------------------------------------------------------------
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] SteNicholas commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #4138: add drop_role and set_default_role antlr visitor for MySQL DCLStatement
URL: https://github.com/apache/incubator-shardingsphere/pull/4138#discussion_r373826607
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/visitor/dcl/drop_role.xml
 ##########
 @@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-parser-test-cases>
+    <common sql-case-id="drop_role" />
 
 Review comment:
   Should this use drop-role not common?

----------------------------------------------------------------
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