jackylee-ch commented on PR #941:
URL: https://github.com/apache/paimon-rust/pull/941#issuecomment-5911625757

   Addressed. `delete_branch` now refuses a branch that a reader is configured 
to consult. `proc_delete_branch` calls 
`BranchManager::ensure_branch_deletable(table.schema().options(), name)` for 
each branch before dropping it, and that helper checks both 
`scan.primary-branch` and `scan.fallback-branch`, mirroring Java 
`AbstractFileStoreTable.deleteBranch` down to the "Unset '…' first" message. 
Your reproducer now returns the guard error and leaves the configured branch in 
place instead of removing it.
   
   Added the SQL regressions:
   
   - `test_delete_branch_preserves_scan_configured_branch` runs the full CALL 
path for both option keys: `sys.delete_branch` on the configured branch fails 
and the branch survives, while an unrelated branch is still deleted, so the 
guard is not over-broad.
   - `test_delete_branch_batch_stops_at_protected_branch` covers a 
comma-separated request `keep,prod` where the protected branch is not listed 
first: the call fails and `prod` is preserved. Names before the protected one 
are dropped first, matching Java `Table.deleteBranches`, which loops 
`deleteBranch` per name; the protected branch itself is never dropped.
   
   I verified the tests are non-vacuous: neutering the check makes both fail 
with "expected error, got Ok" (the protected branch is deleted); restoring it 
passes. Rebased onto current main. `procedures` (35 tests) and `branch_manager` 
(19 tests, including the two `ensure_branch_deletable` unit tests) pass; 
`clippy -p paimon -p paimon-datafusion --all-targets -D warnings` is clean.
   


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