Skip to content

Add a functional test for invalid JSON shared-data bucket counts in Native - #117739

Merged
Avogar merged 2 commits into
masterfrom
json-native-invalid-shared-data-buckets-test
Sep 16, 2026
Merged

Avogar merged 2 commits into
masterfrom
json-native-invalid-shared-data-buckets-test

Conversation

@Avogar

@Avogar Avogar commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Related: #110590

Adds a stateless test covering the validation of the V3 shared_data_buckets count in a JSON/Object Native structure prefix. Until now this was only covered by the gtest ObjectSerialization.InvalidNumberOfSharedDataBuckets, which drives the serialization directly instead of going through the Native reader.

The test feeds crafted Native blocks through format and asserts the error code for every corner of the guard: 0, SIZE_MAX and 257 are rejected as INCORRECT_DATA, while 256 - the maximum - passes the guard and fails only because the crafted block has no payload after the prefix.

The guard itself landed in #110590.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Version info

  • Merged into: 26.9.1.1587 (included in 26.9 and later)

…ative

`SerializationObject::deserializeObjectStructureStatePrefix` validates the V3
`shared_data_buckets` count read from the stream, but the only coverage is the gtest
`ObjectSerialization.InvalidNumberOfSharedDataBuckets`, which drives the serialization
directly rather than the `Native` reader.

Add a stateless test that feeds crafted `Native` blocks through `format` and asserts the
error code for each corner of the guard: `0`, `SIZE_MAX` and `257` are rejected as
`INCORRECT_DATA`, while `256` - the maximum - passes the guard and fails only on the
truncated payload. The structure is passed to `format` explicitly, otherwise schema
inference wraps the error and the query reports `CANNOT_EXTRACT_TABLE_STRUCTURE` instead.

The guard itself landed in #110590.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [eaba185]

Summary: ✅


AI Review

Summary

This PR adds a stateless Native-format corruption test for the V3 JSON shared-data bucket-count guard, covering rejected counts (0, SIZE_MAX, and 257) plus the accepted upper bound (256) via a downstream truncated-payload failure. The test exercises the current Native input path cleanly and is consistent with the existing ObjectSerialization.InvalidNumberOfSharedDataBuckets gtest; I did not find any correctness, coverage, or PR-metadata issue in the patch.

Final Verdict

Status: ✅ Approve

@Avogar
Avogar added this pull request to the merge queue Sep 16, 2026
Merged via the queue into master with commit 1e92b12 Sep 16, 2026
177 checks passed
@Avogar
Avogar deleted the json-native-invalid-shared-data-buckets-test branch September 16, 2026 13:06
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 16, 2026
@clickhouse-gh clickhouse-gh Bot added comp-json-datatype JSON/Dynamic/Object datatype: semi-structured column storage, typed and dynamic paths, sub-object... and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-json-datatype JSON/Dynamic/Object datatype: semi-structured column storage, typed and dynamic paths, sub-object... pr-not-for-changelog This PR should not be mentioned in the changelog 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.

2 participants