Commit a205c6c
[fix](auth) Fix test failures in CTE privilege check tests
### What problem does this PR solve?
Issue Number: N/A
Related PR: #62339
Problem Summary:
Fix two test failures introduced in the CTE privilege bypass fix:
1. **test_cte_privilege_check.groovy**: The regression test user lacked
database-level access to `regression_test`, causing `connect()` to fail
before any CTE query was executed. Added `grant select_priv on
regression_test` to the test setup.
2. **TestCheckPrivileges.testCtePrivilegeCheck**: The new test method called
`useUser("test_cte_privilege_user")` on the shared `connectContext` but
never restored it. When `testPrivilegesAndPolicies` ran afterward, the
unprivileged user caused `createCatalog` to throw `AnalysisException`
instead of the expected `DdlException`. Wrapped the test body in
try-finally to restore root user.
### Release note
None
### Check List (For Author)
- Test: Unit Test / Regression test fix
- Behavior changed: No
- Does this need documentation: No
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent f0c436f commit a205c6c
File tree
2 files changed
+40
-35
lines changed- fe/fe-core/src/test/java/org/apache/doris/nereids/privileges
- regression-test/suites/auth_p0
2 files changed
+40
-35
lines changedLines changed: 39 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
288 | 262 | | |
289 | 263 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
0 commit comments