Commit 2a7e7f7
[fix](auth) Fix test failures in CTE privilege check tests
### What problem does this PR solve?
Issue Number: N/A
Related PR: apache#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 455ff06 commit 2a7e7f7
2 files changed
Lines changed: 40 additions & 35 deletions
File tree
- fe/fe-core/src/test/java/org/apache/doris/nereids/privileges
- regression-test/suites/auth_p0
Lines changed: 39 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
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 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
286 | 260 | | |
287 | 261 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 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 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
294 | 298 | | |
295 | 299 | | |
296 | 300 | | |
| |||
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