Skip to content

Forbid empty part name in detached part operations - #98299

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix-empty-part-name
Feb 28, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix-empty-part-name

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Feb 28, 2026 •

Copy link
Copy Markdown
Member

Closes #98052

Summary

  • Added an empty name check to validateDetachedPartName so that ALTER TABLE ... DROP DETACHED PART '' and ALTER TABLE ... ATTACH PART '' throw a proper BAD_DATA_PART_NAME error instead of a LOGICAL_ERROR exception
  • Added a test for empty part names

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=0c6b9571104017f6a5811dba92571887b1a62e15&name_0=MasterCI&name_1=BuzzHouse%20%28amd_debug%29

Changelog category (leave one):

  • CI Fix or Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Forbid empty part name in ALTER TABLE ... DROP DETACHED PART and ALTER TABLE ... ATTACH PART to avoid a LOGICAL_ERROR exception.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

🤖 Generated with Claude Code

Version info

  • Merged into: 26.3.1.152

`ALTER TABLE ... DROP DETACHED PART ''` and `ALTER TABLE ... ATTACH PART ''`
with an empty part name triggered a `LOGICAL_ERROR` exception in
`PartsTemporaryRename::tryRenameAll`. Added an empty name check to
`validateDetachedPartName` so it throws a proper `BAD_DATA_PART_NAME` error.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=0c6b9571104017f6a5811dba92571887b1a62e15&name_0=MasterCI&name_1=BuzzHouse%20%28amd_debug%29

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Feb 28, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [09fdc20]

Summary: ❌

job_name test_name status info comment
BuzzHouse (arm_asan) failure
Logical error: Cannot find the original scope of the column 'A'. Current scope: B (STID: 2411-4eeb) FAIL cidb

@alexey-milovidov alexey-milovidov self-assigned this Feb 28, 2026
@alexey-milovidov
alexey-milovidov merged commit e5dcd90 into master Feb 28, 2026
143 of 144 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-empty-part-name branch February 28, 2026 19:02
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 28, 2026
alexey-milovidov added a commit that referenced this pull request Mar 1, 2026
Forbid empty part name in detached part operations
@clickgapai

Copy link
Copy Markdown
Contributor

Hi @alexey-milovidov — the changelog category for this PR might need a look.

Current: CI Fix or Improvement
Suggested: Bug Fix (user-visible misbehavior in an official stable release)

Why: The code adds validation to reject empty part names in detached part operations (DROP DETACHED PART and ATTACH PART), which is a user-visible fix preventing invalid operations that could cause issues.

Could you verify this is correct? Ignore if the current category is intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logical error: 'Empty part name. Most likely it's a bug.'

3 participants