Repository navigation
Conversation
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-7:20260706-145700 |
|
cc @evillique — small parser fix: reject data type names starting with a digit, which the formatter prints unquoted and re-lexes as a number literal (breaks the AST round-trip, STID 1941-1bfa). Closes #109501. |
A back-quoted type name whose first character is a digit (e.g. Nullable(`255`)) is printed unquoted by the formatter (Nullable(255)). The unquoted name then re-lexes as a number literal (ASTLiteral) instead of a type name (ASTDataType), so the format-parse-format AST round-trip check in executeQuery diverges and aborts debug/sanitizer builds with an Inconsistent AST formatting LOGICAL_ERROR (STID 1941-1bfa). Real data type names never start with a digit, so reject them at parse time, alongside the existing rejection of non-word-char names. Co-Authored-By: Claude Opus 4.8 <[email protected]>
e0d553a to
35e322a
Compare
|
Workflow [PR], commit [35e322aa] Summary: ✅
AI ReviewSummaryThis PR rejects digit-leading quoted data type names in Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 5/5 (100.00%) · Uncovered code |
CI finish ledger — 35e322aCI fully finished (Finish Workflow: success, Mergeable Check: success). No test failures.
All checks green apart from the private CH Inc sync. No PR-caused failures, no flaky/infra failures. Session id: cron:our-pr-ci-monitor:20260707-153000 |
|
Superseded by #109720 (merged to master 2026-07-08), which applies the identical parse-time guard rejecting type names whose first character is a digit, for the same root cause (STID 1941-1bfa). Master also carries regression coverage in |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix an
Inconsistent AST formattinglogical error (server abort in debug/sanitizer builds) when a back-quoted data type name starts with a digit, e.g.Nullable(`255`). Such a name is now rejected at parse time.Description
Closes: #109501
Found by the AST fuzzer (STID
1941-1bfa). A back-quoted type name whose first character is a digit (e.g.Nullable(`255`)) is printed unquoted by the formatter (Nullable(255)). The unquoted name then re-lexes as a number literal (ASTLiteral) instead of a type name (ASTDataType), so the format-parse-format AST round-trip check inexecuteQuerydiverges and aborts debug/sanitizer builds with anInconsistent AST formattinglogical error.Minimal reproducer:
Root cause:
ParserDataTypeaccepted any word-char string as a type name, including all-digit names.ASTDataType::formatImplprints the name unquoted, so a digit-leading name does not survive the round trip. Real data type names never start with a digit, so this rejects them at parse time (returning a normalSYNTAX_ERROR), alongside the existing rejection of non-word-char names (`x.y`,`Null`).Regression test added to
03210_inconsistent_formatting_of_data_types(the canonical test for this STID family).CI report of the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109288&sha=749cbb09b5f36bf574dce5707ca1e496db0840bd&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%2C%20old_compatibility%29