liutang123 opened a new pull request, #60837:
URL: https://github.com/apache/doris/pull/60837
### What problem does this PR solve?
If we have tow tables: `delete_target` and `delete_from`.
we delete `delete_target` by `delete_from` as follows:
```
create table delete_target (id int) unique key (id) DISTRIBUTED BY HASH
(id) PROPERTIES ("replication_allocation" = "tag.location.default: 1");
insert into delete_target values (1);
create table delete_from (id int, t datetime) PROPERTIES
("replication_allocation" = "tag.location.default: 1");
insert into delete_from values (1, '2024-01-01 00:00:00');
insert into delete_from select * from delete_from; -- 2
insert into delete_from select * from delete_from; -- 4
insert into delete_from select * from delete_from; -- 8
insert into delete_from select * from delete_from; -- 16
insert into delete_from select * from delete_from; -- 32
insert into delete_from select * from delete_from; -- 64
analyze table delete_from;
-- wait some time for tablet report. fe will detect delete_from has more
rows than delete_target. fe will choose delete_from ritht anti join
delete_target
create user delete_test;
GRANT SELECT_PRIV ON test.delete_from to delete_test;
GRANT LOAD_PRIV ON test.delete_target to delete_test;
SET PASSWORD FOR delete_test = PASSWORD('123');
mysql -h 127.0.0.1 -u delete_test -p123 -P 9030 -A -c test
delete from delete_target a where not EXISTS ( SELECT 1 FROM delete_from
WHERE id = a.id and t >'2023-01-01 00:00' );
```
The error is:
```
LOAD command denied to user 'delete_test'@'172.19.0.1' for table 'test:
delete_from'
```
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [*] Regression test
- [ ] 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.
- [] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [*] 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 <!-- Add branch pick label that this PR should
merge into -->
--
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]