yuqi1129 opened a new pull request, #14715:
URL: https://github.com/apache/gravitino/pull/14715

   ### What changes were proposed in this pull request?
   
   `PostgreSqlTableOperations.dropTable` runs `DROP TABLE "schema"."table"` 
instead of an unqualified `DROP TABLE "table"`.
   
   ### Why are the changes needed?
   
   An unqualified name is resolved through the search path, and PostgreSQL 
leaves out a schema the catalog user has no USAGE privilege on. The drop then 
failed with `42P01` and was reported as a missing table. With the qualified 
name, PostgreSQL refuses it with `42501`, which maps to `ForbiddenException` 
(403), and nothing is removed.
   
   Fixes #14714
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Dropping a table in a schema the catalog user cannot use returns 403 
instead of `{"dropped": false}`. A missing table or schema still returns 
`false`.
   
   ### How was this patch tested?
   
   - New `TestPostgreSqlTableDropPrivileges` (4 cases): qualified and escaped 
SQL, 42501 → `ForbiddenException`, 42P01 and 3F000 still return `false`.
   - `TestPostgreSqlTableOperations` on PostgreSQL in Docker (44 cases, 1 new): 
a role without schema USAGE gets `ForbiddenException` and the table remains; an 
admin drop still works and a second drop returns `false`.
   - With the change reverted, all 5 new cases fail.
   


-- 
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]

Reply via email to