Skip to content

Commit

Permalink
Support Oracle noAuditTraditional SQL parse (#29145)
Browse files Browse the repository at this point in the history
  • Loading branch information
chakkk309 authored Nov 23, 2023
1 parent 5b1b378 commit a1a3ed1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2304,7 +2304,7 @@ auditUnified
: AUDIT (auditPolicyClause | contextClause)
;

noAudit
noAuditUnified
: NOAUDIT (noAuditPolicyClause | contextClause)
;

Expand Down Expand Up @@ -4138,3 +4138,11 @@ createProfile
: CREATE MANDATORY? PROFILE profileName LIMIT (resourceParameters | passwordParameters)+ (CONTAINER EQ_ (CURRENT | ALL))?
;

noAudit
: noAuditTraditional | noAuditUnified
;

noAuditTraditional
: NOAUDIT (auditOperationClause auditingByClause? | auditSchemaObjectClause | NETWORK | DIRECT_PATH LOAD auditingByClause?)
(WHENEVER NOT? SUCCESSFUL)? (CONTAINER EQ_ (CURRENT | ALL))?
;
4 changes: 4 additions & 0 deletions test/it/parser/src/main/resources/case/ddl/no-audit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
<no-audit sql-case-id="no_audit_policy_by_users" />
<no-audit sql-case-id="no_audit_policy_by_users_with_roles" />
<no-audit sql-case-id="no_audit_context" />
<no-audit sql-case-id="no_audit_traditional_all_privileges" />
<no-audit sql-case-id="no_audit_traditional_all_statements" />
<no-audit sql-case-id="no_audit_traditional_delete" />
<no-audit sql-case-id="no_audit_traditional_select" />
</sql-parser-test-cases>
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
<sql-case id="no_audit_policy_by_users" value="NOAUDIT POLICY dml_pol BY hr, sh WHENEVER NOT SUCCESSFUL" db-types="Oracle" />
<sql-case id="no_audit_policy_by_users_with_roles" value="NOAUDIT POLICY read_dir_pol BY USERS WITH GRANTED ROLES hr_role" db-types="Oracle" />
<sql-case id="no_audit_context" value="NOAUDIT CONTEXT NAMESPACE userenv ATTRIBUTES current_user, db_name BY hr;" db-types="Oracle" />
<sql-case id="no_audit_traditional_all_privileges" value="NOAUDIT ALL PRIVILEGES;" db-types="Oracle" />
<sql-case id="no_audit_traditional_all_statements" value="NOAUDIT ALL STATEMENTS;" db-types="Oracle" />
<sql-case id="no_audit_traditional_delete" value="NOAUDIT DELETE ANY TABLE;" db-types="Oracle" />
<sql-case id="no_audit_traditional_select" value="NOAUDIT SELECT ON hr.employees WHENEVER SUCCESSFUL;" db-types="Oracle" />
</sql-cases>

0 comments on commit a1a3ed1

Please sign in to comment.