Fix CHECK TABLE with sparse serialization inside Tuple with Dynamic#99351
Fix CHECK TABLE with sparse serialization inside Tuple with Dynamic#99351
Conversation
|
Workflow [PR], commit [e405b10] Summary: ✅ AI ReviewSummaryThis PR fixes a real correctness issue in Missing context
ClickHouse Rules
Final Verdict
|
…le-sparse-dynamic
|
One of the stress test failures rate might've increased by now reverted #99311. Merging master to remove the noise. The test is still flaky, but chances it will be red are smaller. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 100.00% (12/12, 0 noise lines excluded) |
…side Tuple with Dynamic
…nside Tuple with Dynamic
…side Tuple with Dynamic
…side Tuple with Dynamic
Backport #99351 to 26.2: Fix CHECK TABLE with sparse serialization inside Tuple with Dynamic
Backport #99351 to 26.1: Fix CHECK TABLE with sparse serialization inside Tuple with Dynamic
Backport #99351 to 25.12: Fix CHECK TABLE with sparse serialization inside Tuple with Dynamic
…side Tuple with Dynamic
Backport #99351 to 25.8: Fix CHECK TABLE with sparse serialization inside Tuple with Dynamic
…tionSparse Commit e338032 accidentally removed the 'if (max_rows_to_read == 0) return 0' early return that was introduced by PR ClickHouse#99351 to fix CHECK TABLE on Tuple columns containing Dynamic elements with sparse-serialized sub-columns (issue ClickHouse#96588). The removed guard was replaced with 'if (max_rows_to_read && ...)' guards on the two conditions below, but those do not short-circuit the function: the read loop still executes when limit=0, reading an extra row instead of returning immediately. This regresses test 04038_check_table_sparse_tuple_dynamic. Restore the original early return and remove the spurious 'max_rows_to_read &&' guard from the loop condition, since it is now unreachable when limit=0.

Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix CHECK TABLE with sparse serialization inside Tuple with Dynamic. Closes #96588
Documentation entry for user-facing changes
Note
Medium Risk
Touches core sparse deserialization logic used during reads/validation; small but could affect edge cases in how offsets/state are advanced across granules.
Overview
Fixes
SerializationSparse::deserializeOffsetsto treatlimit=0(and thusoffset+limit==0) as read zero rows instead of behaving like an unbounded read, and simplifies the boundary check logic accordingly.Adds a stateless regression test covering
CHECK TABLEon aTuplecontaining aDynamicelement and a sparse-serialized nested tuple, which previously failed with tuple size mismatches.Written by Cursor Bugbot for commit e405b10. This will update automatically on new commits. Configure here.