Skip to content

Conversation

@zhyass
Copy link
Member

@zhyass zhyass commented Jan 10, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

This PR tightens schema safety guarantees around table branches by introducing additional validation in branch creation and schema-altering operations.

1. Branch creation schema validation

When creating a branch, the system now verifies that the snapshot used as the branch base has the same schema as the current table.
If the schemas differ, branch creation will fail with an explicit error.
This prevents branches from being created on top of incompatible or outdated schemas.

2. Restrict schema rebuild operations with active branches

For ADD COLUMN and MODIFY COLUMN operations that require data rebuild, the system now checks whether the table has any active branches.
If active branches exist, the operation is rejected.
This avoids introducing inconsistencies between the main table and its branches during schema-altering rebuilds.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe): enhance

This change is Reviewable

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Jan 10, 2026
@zhyass zhyass requested a review from dantengsky January 10, 2026 15:45
@zhyass
Copy link
Member Author

zhyass commented Jan 12, 2026

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@zhyass zhyass marked this pull request as draft January 13, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-chore this PR only has small changes that no need to record, like coding styles.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant