Commit e4facdf
[fix](fe) Skip auth for DeleteFromUsingCommand fallback in DeleteFromCommand
### What problem does this PR solve?
Problem Summary: Moving privChecked from StatementContext to CascadesContext
(for the CTE privilege bypass fix) caused a regression in DELETE commands
with complex WHERE clauses (e.g. NOT EXISTS subquery).
DeleteFromCommand sets skipAuth=true during initial Nereids planning because
DELETE does not need SELECT privilege. Previously, the privChecked flag on
StatementContext was shared across planners, so when DeleteFromUsingCommand
created a new planner, CheckPrivileges would see privChecked=true and skip.
After moving privChecked to CascadesContext, the new planner gets a fresh
CascadesContext with privChecked=false, causing CheckPrivileges to run
auth checks without skipAuth=true, failing on tables the user only has
LOAD privilege for.
Fix: Wrap both DeleteFromUsingCommand.run() call sites in skipAuth=true,
consistent with the initial planning phase's auth policy.
### Release note
None
### Check List (For Author)
- Test: Regression test (test_dml_delete_table_auth)
- Behavior changed: No
- Does this need documentation: No
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent fae0768 commit e4facdf
File tree
1 file changed
+16
-4
lines changed- fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands
1 file changed
+16
-4
lines changedLines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
| |||
219 | 225 | | |
220 | 226 | | |
221 | 227 | | |
222 | | - | |
223 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
224 | 236 | | |
225 | 237 | | |
226 | 238 | | |
| |||
0 commit comments