heguanhui opened a new pull request, #63638:
URL: https://github.com/apache/doris/pull/63638
### What problem does this PR solve?
Issue Number: close #xxx
Problem Summary: `DROP ROW POLICY ... FOR ROLE <role_name>` does not
validate whether the role exists, while `CREATE ROW POLICY ... FOR ROLE
<role_name>` does validate. This inconsistency allows dropping a row policy
with a non-existent role name without any error.
Additionally, when `IF EXISTS` is specified, the role existence check should
be skipped because if the role doesn't exist, the corresponding policy cannot
exist either (since creation validates the role). The `IF EXISTS` semantics
should silently return in this case.
### Release note
Fix: `DROP ROW POLICY ... FOR ROLE <non_exist_role>` now throws an error
when the role does not exist, consistent with `CREATE ROW POLICY` behavior.
`DROP ROW POLICY IF EXISTS ... FOR ROLE <non_exist_role>` silently returns as
expected.
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [x] Yes. `DROP ROW POLICY ... FOR ROLE <non_exist_role>` now throws
AnalysisException when role does not exist. `DROP ROW POLICY IF EXISTS ... FOR
ROLE <non_exist_role>` silently returns.
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]