jackylee-ch commented on PR #942:
URL: https://github.com/apache/paimon-rust/pull/942#issuecomment-5943097373
Both addressed.
**[P1] Source-name validation.** `rename_branch` now validates the *source*
name before any filesystem access, so `from_branch => 'b1/schema'` is rejected
up front and `branch-b1` is left intact — it no longer moves the inner `schema`
directory. Your reproduction now fails at validation instead of orphaning the
branch's metadata.
**[P2] Target names a reader cannot open.**
`BranchManager::validate_branch_name` now delegates to the catalog's shared
`validate_branch_name` (the exact contract `Table::copy_with_branch` and
`$branch_...` resolution enforce): it rejects blank, `.`/`..`, path separators
and control characters, and then keeps the manager's extra main/numeric
restrictions. So `to_branch => '..'` is rejected before any move, rather than
renaming a branch to a name the table API cannot open.
Regression `test_rename_branch_rejects_unopenable_source_and_target`: after
seeding a `b1`, both `from_branch => 'b1/schema'` and `to_branch => '..'` fail,
`b1` stays listed in `$branches`, and `table.copy_with_branch("b1")` still
opens it. Unit coverage
`test_validate_branch_name_rejects_reader_unopenable_names` pins
`.`/`..`/control-char rejection at the manager. I verified non-vacuity:
dropping the source guard makes the `b1/schema` rename succeed and the test
fail; restoring it passes.
Rebased onto current main. `procedures` (35 tests) and `branch_manager` (19
tests) pass; `clippy -p paimon -p paimon-datafusion --all-targets --features
fulltext,vortex -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]