Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parsing Oracle NOAUDIT ALL sql #29145

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>