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 2022/07/10 04:03:52 UTC

[GitHub] [shardingsphere] Trydamere opened a new pull request, #18987: support alter audit policy in oracle

Trydamere opened a new pull request, #18987:
URL: https://github.com/apache/shardingsphere/pull/18987

   Ref https://github.com/apache/shardingsphere/issues/6480 & https://github.com/apache/shardingsphere/issues/18431
   
   Changes proposed in this pull request:
   
   Changes proposed in this pull request:
   - Add alter audit policy grammar
   - Support alter audit policy in Oracle
   - Add test
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #18987: support alter audit policy in oracle

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #18987:
URL: https://github.com/apache/shardingsphere/pull/18987#discussion_r917473941


##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4:
##########
@@ -17,7 +17,7 @@
 
 grammar DDLStatement;
 
-import BaseRule;
+import BaseRule,  DCLStatement;

Review Comment:
   Please keep one space between BaseRule and DCLStatement.



##########
shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/AlterAuditPolicyStatement.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.common.statement.ddl;
+
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
+
+/**
+ * Alter audit policy statement.
+ */
+@ToString

Review Comment:
   Please remove this useless @ToString annotation.



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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu merged pull request #18987: support alter audit policy in oracle

Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #18987:
URL: https://github.com/apache/shardingsphere/pull/18987


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Trydamere commented on a diff in pull request #18987: support alter audit policy in oracle

Posted by GitBox <gi...@apache.org>.
Trydamere commented on code in PR #18987:
URL: https://github.com/apache/shardingsphere/pull/18987#discussion_r917354805


##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4:
##########
@@ -2548,3 +2548,184 @@ resolveClauses
 resolveClause
     : LP_ matchString DOT_? (schemaName | MINUS_) RP_
     ;
+
+alterAuditPolicy
+    : ALTER AUDIT POLICY policyName
+        (ADD (privilegeAuditClause)? (actionAuditClause)? (roleAuditClause)? (ONLY TOPLEVEL)?)?
+        (DROP (privilegeAuditClause)? (actionAuditClause)? (roleAuditClause)? (ONLY TOPLEVEL)?)?
+        (CONDITION ( DROP | condition  EVALUATE PER (STATEMENT  | SESSION | INSTANCE)))?
+    ;
+
+privilegeAuditClause
+    : PRIVILEGES systemPrivilegeClause (COMMA_ systemPrivilegeClause)*
+    ;
+
+actionAuditClause
+    : (standardActions | componentActions)*
+    ;
+
+standardActions
+    : ACTIONS (objectAction ON (DIRECTORY directoryName | MINING MODEL objectName | objectName) | systemAction)

Review Comment:
   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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Trydamere commented on a diff in pull request #18987: support alter audit policy in oracle

Posted by GitBox <gi...@apache.org>.
Trydamere commented on code in PR #18987:
URL: https://github.com/apache/shardingsphere/pull/18987#discussion_r917485432


##########
shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/AlterAuditPolicyStatement.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.common.statement.ddl;
+
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
+
+/**
+ * Alter audit policy statement.
+ */
+@ToString

Review Comment:
   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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] codecov-commenter commented on pull request #18987: support alter audit policy in oracle

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18987:
URL: https://github.com/apache/shardingsphere/pull/18987#issuecomment-1179655149

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18987?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18987](https://codecov.io/gh/apache/shardingsphere/pull/18987?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b6f8137) into [master](https://codecov.io/gh/apache/shardingsphere/commit/ee22317d15e799f0d1d5e286da5567fca339fd11?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ee22317) will **increase** coverage by `0.00%`.
   > The diff coverage is `70.00%`.
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #18987   +/-   ##
   =========================================
     Coverage     59.36%   59.36%           
   - Complexity     2316     2317    +1     
   =========================================
     Files          3799     3802    +3     
     Lines         54664    54664           
     Branches       9241     9241           
   =========================================
   + Hits          32452    32453    +1     
   + Misses        19482    19481    -1     
     Partials       2730     2730           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18987?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...t/status/SetReadwriteSplittingStatusStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy1kaXN0c3FsLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcmVhZHdyaXRlc3BsaXR0aW5nL2Rpc3RzcWwvcGFyc2VyL3N0YXRlbWVudC9zdGF0dXMvU2V0UmVhZHdyaXRlU3BsaXR0aW5nU3RhdHVzU3RhdGVtZW50LmphdmE=) | `0.00% <ø> (ø)` | |
   | [...ommon/statement/ddl/AlterAuditPolicyStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kZGwvQWx0ZXJBdWRpdFBvbGljeVN0YXRlbWVudC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...nt/oracle/ddl/OracleAlterAuditPolicyStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvb3JhY2xlL2RkbC9PcmFjbGVBbHRlckF1ZGl0UG9saWN5U3RhdGVtZW50LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...end/text/distsql/DistSQLBackendHandlerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvRGlzdFNRTEJhY2tlbmRIYW5kbGVyRmFjdG9yeS5qYXZh) | `38.88% <50.00%> (ø)` | |
   | [...phere/proxy/backend/session/ConnectionSession.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9zZXNzaW9uL0Nvbm5lY3Rpb25TZXNzaW9uLmphdmE=) | `70.83% <100.00%> (+3.09%)` | :arrow_up: |
   | [...r/statement/impl/OracleDDLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlRERMU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `87.97% <100.00%> (+0.04%)` | :arrow_up: |
   | [...l/parser/core/database/visitor/SQLVisitorRule.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWVuZ2luZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9jb3JlL2RhdGFiYXNlL3Zpc2l0b3IvU1FMVmlzaXRvclJ1bGUuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   | [...eterized/jaxb/cases/domain/SQLParserTestCases.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vU1FMUGFyc2VyVGVzdENhc2VzLmphdmE=) | `99.87% <100.00%> (+<0.01%)` | :arrow_up: |
   | [...atement/ddl/AlterAuditPolicyStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/18987/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RkbC9BbHRlckF1ZGl0UG9saWN5U3RhdGVtZW50VGVzdENhc2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18987?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18987?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [1c91f71...b6f8137](https://codecov.io/gh/apache/shardingsphere/pull/18987?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #18987: support alter audit policy in oracle

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #18987:
URL: https://github.com/apache/shardingsphere/pull/18987#discussion_r917346666


##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4:
##########
@@ -2548,3 +2548,184 @@ resolveClauses
 resolveClause
     : LP_ matchString DOT_? (schemaName | MINUS_) RP_
     ;
+
+alterAuditPolicy
+    : ALTER AUDIT POLICY policyName
+        (ADD (privilegeAuditClause)? (actionAuditClause)? (roleAuditClause)? (ONLY TOPLEVEL)?)?
+        (DROP (privilegeAuditClause)? (actionAuditClause)? (roleAuditClause)? (ONLY TOPLEVEL)?)?
+        (CONDITION ( DROP | condition  EVALUATE PER (STATEMENT  | SESSION | INSTANCE)))?
+    ;
+
+privilegeAuditClause
+    : PRIVILEGES systemPrivilegeClause (COMMA_ systemPrivilegeClause)*
+    ;
+
+actionAuditClause
+    : (standardActions | componentActions)*
+    ;
+
+standardActions
+    : ACTIONS (objectAction ON (DIRECTORY directoryName | MINING MODEL objectName | objectName) | systemAction)

Review Comment:
   Can you extract these rules to new sub syntax rules?



##########
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4:
##########
@@ -2548,3 +2548,184 @@ resolveClauses
 resolveClause
     : LP_ matchString DOT_? (schemaName | MINUS_) RP_
     ;
+
+alterAuditPolicy
+    : ALTER AUDIT POLICY policyName
+        (ADD (privilegeAuditClause)? (actionAuditClause)? (roleAuditClause)? (ONLY TOPLEVEL)?)?

Review Comment:
   Can you extract these rules to new sub syntax rules?



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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org