Skip to content

Cherry pick #131029 to 26.3: Fix use-after-free on renaming Delta Lake columns to their physical names - #131112

Merged
robot-ch-test-poll3 merged 7 commits into
backport/26.3/131029from
cherrypick/26.3/131029
Nov 14, 2026
Merged

robot-ch-test-poll3 merged 7 commits into
backport/26.3/131029from
cherrypick/26.3/131029

Conversation

@robot-ch-test-poll

Copy link
Copy Markdown
Contributor

Original pull-request #131029

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Before you resolve anything

Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

alexey-milovidov and others added 6 commits November 12, 2026 10:00
…ames

`DeltaLakeMetadataDeltaKernel::prepareReadingFromFormat` renamed the requested columns to their physical names in
place, while iterating over the same `ColumnsDescription`. Under column mapping the physical name of a column can be
the logical name of another one: after `k` is renamed to `k_old` and `v` to `k`, `k_old` is stored as `k`. When `k_old`
comes first, `ColumnsDescription::rename` to the existing `k` makes `modify_key` erase `k_old`, and the loop reads the
freed node. Build a new description with the physical names instead.

Found by the AST fuzzer in the stress test of #120906:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=120906&sha=4b935993be52f957f83759b7ea8fa1a133ae82c5&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%29

Caused by: #130793

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e case

Pass `HTTPConnectionGroupType::STORAGE` to `createClientConfiguration`, the same as the master fix. Remove the
`WHERE` query from the test: with filter push down it depends on the separate filter-mapping bug.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The `AmberMap` sync #129464 is reverted in #131043, so `createClientConfiguration` takes `bool for_disk_s3` again.

Related: #131043

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ename-uaf

Fix use-after-free on renaming Delta Lake columns to their physical names
@robot-ch-test-poll robot-ch-test-poll added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels Nov 12, 2026
Resolve the conflicts of the backport of #131029 to 26.3:
- `DeltaLakeMetadataDeltaKernel::prepareReadingFromFormat`: keep the fix (build a new
  `ColumnsDescription` instead of renaming in place), using the 26.3 `DeltaLake::getPhysicalName`.
- 26.3 has no top-K dynamic filtering, so drop the `supportsTopKDynamicFilter` guard, the
  `columns_read_under_other_names` field that only it used, and the test
  `05620_delta_lake_top_k_dynamic_filtering_column_mapping`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@robot-ch-test-poll3
robot-ch-test-poll3 merged commit 7a2288b into backport/26.3/131029 Nov 14, 2026
2 checks passed
@robot-ch-test-poll3
robot-ch-test-poll3 deleted the cherrypick/26.3/131029 branch November 14, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants