bobhan1 opened a new pull request, #60565:
URL: https://github.com/apache/doris/pull/60565
### What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
Fix incorrect `isDomain` flag parsing in `SET PASSWORD` statement.
When parsing `SET PASSWORD FOR 'user'@'host'` statement, the `isDomain` flag
was incorrectly set to `true` because the previous code used
`ctx.userIdentify().ATSIGN() != null` to determine if a user is a domain user.
Since the `@` symbol always exists in `'user'@'host'` format, `isDomain` was
always `true`, which is wrong.
The correct behavior:
- `'user'@'host'` (single quotes) → `isDomain = false` (regular user)
- `'user'@("domain")` (parentheses around host) → `isDomain = true` (domain
user)
This PR fixes the issue by reusing the existing `visitUserIdentify()` method
which correctly handles the `isDomain` flag.
### Release note
Fix SET PASSWORD statement incorrectly marking regular users as domain users.
### Check List (For Author)
- Test
- [x] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- Behavior changed:
- [x] Yes. Previously `SET PASSWORD FOR 'user'@'%'` would fail because
the user was incorrectly treated as a domain user. Now it works correctly.
- Does this need documentation?
- [x] No.
### 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]