Skip to content

Cherry pick #131797 to 26.3: Bounds-check skipping fully filtered values in the Parquet PLAIN string decoder - #132239

Merged
robot-clickhouse-ci-2 merged 5 commits into
backport/26.3/131797from
cherrypick/26.3/131797
Nov 17, 2026
Merged

robot-clickhouse-ci-2 merged 5 commits into
backport/26.3/131797from
cherrypick/26.3/131797

Conversation

@robot-ch-test-poll

Copy link
Copy Markdown
Contributor

Original pull-request #131797

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 4 commits November 15, 2026 13:01
…ring decoder

When `PREWHERE` filters out every value of a page, `PlainStringDecoder` (with a non-trivial converter, e.g. reading `Geometry` from WKB) skipped the values with its own loop that did not check the lengths against the page size, so a malformed page could make it read out of bounds. Use `skip`, which checks them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ringDecoder`

The decoder loaded the four-byte length prefix before checking the remaining bytes, relying on the
input being padded. A page retained directly from a page-cache cell is not padded, so a malformed page
could still read up to four bytes beyond the allocation. Check that the prefix itself is available in
every loop of `PlainStringDecoder`.

Add a regression case that corrupts a `PLAIN` `BYTE_ARRAY` length in a page whose rows are all
rejected by `PREWHERE` while other rows of the block pass, and expects `INCORRECT_DATA`. Verified
that it fails without the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…iltered-page-skip

Bounds-check skipping fully filtered values in the Parquet `PLAIN` string decoder
@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-critical-bugfix labels Nov 17, 2026
Keep the bounds checks of the original PR in `PlainStringDecoder`.

The test reads WKB through `Geometry` via the generic string converter,
which 26.3 does not support (`Cannot convert type String to Geometry`).
Write the column as a GeoParquet `Point` instead: the encoded bytes are the
same, and reading it as `Point` still goes through the non-trivial
`GeoConverter`, so the fully filtered page skip path is still covered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@robot-clickhouse-ci-2
robot-clickhouse-ci-2 merged commit a56c9b6 into backport/26.3/131797 Nov 17, 2026
2 checks passed
@robot-clickhouse-ci-2
robot-clickhouse-ci-2 deleted the cherrypick/26.3/131797 branch November 17, 2026 07:22
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-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants