Skip to content

Backport #116998 to 26.3: Bound PostgreSQL protocol messages by their declared size - #120824

Merged
PedroTadim merged 1 commit into
26.3from
backport/26.3/116998
Sep 18, 2026
Merged

PedroTadim merged 1 commit into
26.3from
backport/26.3/116998

Conversation

@robot-ch-test-poll3

@robot-ch-test-poll3 robot-ch-test-poll3 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #116998
Cherry-pick pull-request #120033

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.33.112

@robot-ch-test-poll3 robot-ch-test-poll3 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Sep 18, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [d0d595c]

Summary: ✅

@PedroTadim
PedroTadim merged commit 0dffc01 into 26.3 Sep 18, 2026
36 checks passed
@PedroTadim
PedroTadim deleted the backport/26.3/116998 branch September 18, 2026 20:17
alexey-milovidov added a commit that referenced this pull request Sep 19, 2026
Resolve the conflicts in `src/Core/PostgreSQLProtocol.h` and
`src/Core/tests/gtest_postgresql_protocol.cpp`.

26.8 does not have the `FrontMessage::deserializePayload` helper that the
original pull request builds on, so the helper is brought in as part of this
backport, together with the `Query` and `Sync` framing checks that the new
`gtest` cases exercise. The remaining hunks apply to the 26.8 sources
unchanged.

The result is identical to the already merged 26.3 backport
#120824 apart from the `= 0`
initializers that 26.8 already carries.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
alexey-milovidov added a commit that referenced this pull request Sep 19, 2026
…ypick/26.7/116998

Resolve the cherry-pick of #116998 onto 26.7.

Conflicts:
	src/Core/PostgreSQLProtocol.h
	src/Core/tests/gtest_postgresql_protocol.cpp

26.7 does not have the `deserializePayload` helper that master gained in
`Keep PostgreSQL messages aligned after parse errors`, and the fix being
backported is only meaningful when the frontend messages are actually read
through it. The resolution therefore brings in the helper together with the
message conversions it enables (`Terminate`, `SASLInitialResponse`,
`SASLResponse`, `PasswordMessage`, `Query`, `Sync`, both `CopyData` variants)
and the `readStringOfDeclaredSize` reader, i.e. exactly the resolution that was
already merged for 26.3 in #120824.

26.7-only differences are kept: the memory-tracking containers
(`UnorderedMapWithMemoryTracking`, `VectorWithMemoryTracking`) and the
explicitly initialized members outside the rewritten blocks. Master-only
changes unrelated to this fix - the `scram_sha256_password` salt selection in
`ScrambleSHA256Auth` - are not pulled in; only `expectPasswordMessage` and its
two call sites, which belong to this fix, are.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants