Skip to content

Commit

Permalink
Fix oracle audit auditOperationClause rule (#28857)
Browse files Browse the repository at this point in the history
  • Loading branch information
zihaoAK47 authored Oct 25, 2023
1 parent 6591722 commit 1f3c09f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2268,7 +2268,7 @@ auditingByClause

auditOperationClause
: (sqlStatementShortcut | ALL | ALL STATEMENTS) (COMMA_ sqlStatementShortcut | ALL | ALL STATEMENTS)*
| (systemPrivilege | ALL PRIVILEGES) (COMMA_ systemPrivilege | ALL PRIVILEGES)
| (systemPrivilege | ALL PRIVILEGES) (COMMA_ systemPrivilege | ALL PRIVILEGES)*
;

sqlStatementShortcut
Expand Down
5 changes: 5 additions & 0 deletions test/it/parser/src/main/resources/case/ddl/audit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,9 @@
<audit sql-case-id="audit_all_on_default_by_access" />
<audit sql-case-id="audit_all_statements_by_by_access_whenever_successful" />
<audit sql-case-id="audit_all_statements_in_session_current" />
<audit sql-case-id="audit_create_any_directory" />
<audit sql-case-id="audit_create_alter" />
<audit sql-case-id="audit_delete_any_table_by_access" />
<audit sql-case-id="audit_crete_table_by_access_whenever_not_successful" />
<audit sql-case-id="audit_select_table_by" />
</sql-parser-test-cases>
5 changes: 5 additions & 0 deletions test/it/parser/src/main/resources/sql/supported/ddl/audit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,9 @@
<sql-case id="audit_all_on_default_by_access" value="AUDIT ALL ON DEFAULT BY ACCESS" db-types="Oracle" />
<sql-case id="audit_all_statements_by_by_access_whenever_successful" value="AUDIT ALL STATEMENTS BY jward, jsmith BY ACCESS WHENEVER SUCCESSFUL" db-types="Oracle" />
<sql-case id="audit_all_statements_in_session_current" value="AUDIT ALL STATEMENTS IN SESSION CURRENT" db-types="Oracle" />
<sql-case id="audit_create_any_directory" value="AUDIT CREATE ANY DIRECTORY" db-types="Oracle" />
<sql-case id="audit_create_alter" value="AUDIT CREATE TABLE, CREATE SEQUENCE, CREATE SYNONYM, CREATE DATABASE LINK, CREATE CLUSTER, CREATE VIEW, ALTER SESSION" db-types="Oracle" />
<sql-case id="audit_delete_any_table_by_access" value="AUDIT DELETE ANY TABLE BY ACCESS" db-types="Oracle" />
<sql-case id="audit_crete_table_by_access_whenever_not_successful" value="AUDIT CREATE TABLE BY ACCESS WHENEVER NOT SUCCESSFUL" db-types="Oracle" />
<sql-case id="audit_select_table_by" value="AUDIT SELECT TABLE BY jackson" db-types="Oracle" />
</sql-cases>

0 comments on commit 1f3c09f

Please sign in to comment.