Skip to content

Fix abort in Protobuf schema inference for a map with an unsupported value - #126906

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
aschoube:fix-protobuf-map-with-unsupported-value
Oct 22, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
aschoube:fix-protobuf-map-with-unsupported-value

Conversation

@aschoube

@aschoube aschoube commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Schema inference for the Protobuf format aborted the server when a map field had a value (or key) of an unsupported type, such as an empty message, a recursive message or an enum that does not fit Enum16, and input_format_protobuf_skip_fields_with_unsupported_types_in_schema_inference = 1. The unsupported value was skipped, leaving a one-element tuple, and DataTypeMap was built from it with an out-of-bounds access. Now the whole map field is skipped, as for other unsupported fields.

Closes: #126836

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC)

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

Fix a server abort during Protobuf schema inference with input_format_protobuf_skip_fields_with_unsupported_types_in_schema_inference = 1 when a map field has a value of an unsupported type. Such map fields are now skipped.


Workflow [PR]
Sync PR [sync-upstream/pr/126906]

Version info

  • Merged into: 26.11.1.594-master (included in 26.11 and later)
  • Backported to: 26.10.2.87, 26.9.26.4, 26.8.35.5, 26.7.38.10, 26.3.61.5

…ted value

With `input_format_protobuf_skip_fields_with_unsupported_types_in_schema_inference = 1`,
an unsupported key or value of a map entry was skipped, leaving a one-element tuple,
and `DataTypeMap` was built from it with an out-of-bounds access. Now the whole `map`
field is skipped.

Closes: ClickHouse#126836
@clickhouse-gh clickhouse-gh Bot added the comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). label Oct 20, 2026
@m-selmi m-selmi added the can be tested Allows running workflows for external contributors label Oct 20, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1676afe]

Summary: ✅


AI Review

Summary

PR #126906 skips incomplete Protobuf map entries during schema inference, preventing an out-of-bounds access in DataTypeMap when unsupported fields are skipped. No actionable findings in commit 1676afe9bac80c840205ff0aa498c7bbb8f94c78.

Missing context / blind spots
  • ⚠️ Runtime validation is pending: the added regression test covers empty messages, recursive messages, oversized enums, strict-mode rejection, and preservation of supported fields, but Fast test skipped it. Full stateless and bugfix validation jobs are pending, and no local ClickHouse binary/build is available. A passing regression run with Protobuf support would close this gap.
Final Verdict

Status: ✅ Approve. No code changes requested; regression execution remains pending CI.

@clickhouse-gh clickhouse-gh Bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! external Author is not a member of the ClickHouse organization labels Oct 20, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 22, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 22, 2026
Merged via the queue into ClickHouse:master with commit e467293 Oct 22, 2026
179 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Oct 22, 2026
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 22, 2026
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Oct 22, 2026
clickhouse-gh Bot added a commit that referenced this pull request Oct 23, 2026
Backport #126906 to 26.9: Fix abort in `Protobuf` schema inference for a `map` with an unsupported value
clickhouse-gh Bot added a commit that referenced this pull request Oct 23, 2026
Backport #126906 to 26.10: Fix abort in `Protobuf` schema inference for a `map` with an unsupported value
clickhouse-gh Bot added a commit that referenced this pull request Oct 23, 2026
Backport #126906 to 26.8: Fix abort in `Protobuf` schema inference for a `map` with an unsupported value
clickhouse-gh Bot added a commit that referenced this pull request Oct 23, 2026
Backport #126906 to 26.7: Fix abort in `Protobuf` schema inference for a `map` with an unsupported value
alexey-milovidov added a commit that referenced this pull request Oct 23, 2026
Backport #126906 to 26.3: Fix abort in `Protobuf` schema inference for a `map` with an unsupported value
leshikus pushed a commit that referenced this pull request Nov 13, 2026
VighneshPath pushed a commit to VighneshPath/ClickHouse that referenced this pull request Nov 23, 2026
…ference for a `map` with an unsupported value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). external Author is not a member of the ClickHouse organization pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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.

Server abort in Protobuf schema inference for map with unsupported value type

5 participants