Skip to content

Reject quoted type names that reparse as bareword literals - #109259

Merged
azat merged 1 commit into
ClickHouse:masterfrom
azat:fix-numeric-quoted-type-name
Nov 13, 2026
Merged

azat merged 1 commit into
ClickHouse:masterfrom
azat:fix-numeric-quoted-type-name

Conversation

@azat

@azat azat commented Jul 3, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog

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

Reject quoted type names that reparse as bareword literals

https://pastila.nl/?0027edc5/e1c8fb2c50604b8a64bad13aa60679e5#75grV3j9PuiO4CfoyIduiA==GCM


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

Version info

  • Merged into: 26.11.1.2162-master (included in 26.11 and later)

@clickhouse-gh

clickhouse-gh Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e3ba303]

Summary: ✅


AI Review

Summary

The PR rejects type names matching TRUE, FALSE, INF, INFINITY, or NAN, case-insensitively, preventing quoted names from reparsing as literals after AST formatting. The earlier findings are addressed, and no new actionable issues were found. The added stateless regression test passes in Fast test for the reviewed head.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 3, 2026
@azat
azat force-pushed the fix-numeric-quoted-type-name branch from fa71e13 to 5f35d77 Compare July 3, 2026 14:02
@clickhouse-gh clickhouse-gh Bot added pr-backward-incompatible Pull request with backwards incompatible changes and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Jul 3, 2026
Comment thread src/Parsers/ParserDataType.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.60% 85.50% -0.10%
Functions 92.70% 92.70% +0.00%
Branches 77.70% 77.70% +0.00%

Changed lines: Changed C/C++ lines covered: 10/10 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the comp-sql-syntax SQL/grammar parsing, AST nodes, syntax-level features. label Sep 4, 2026
Comment thread src/Parsers/ParserDataType.cpp Resolved
@azat azat changed the title Reject quoted type names that start with a digit Reject quoted type names that reparse as bareword literals Nov 12, 2026
@azat
azat force-pushed the fix-numeric-quoted-type-name branch from 5f35d77 to d6ee69c Compare November 12, 2026 18:17
@clickhouse-gh clickhouse-gh Bot added pr-not-for-changelog This PR should not be mentioned in the changelog and removed pr-backward-incompatible Pull request with backwards incompatible changes labels Nov 12, 2026
Nullable(`true`) and DateTime64(`inf`)/`nan` format unquoted and
reparse as literals, breaking the AST formatting round-trip. Reject
TRUE/FALSE/INF/INFINITY/NAN (case-insensitive), like NULL already is.

Co-Authored-By: Claude Fable 5 <[email protected]>
@azat
azat force-pushed the fix-numeric-quoted-type-name branch from d6ee69c to e3ba303 Compare November 12, 2026 20:28
@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing e3ba303e9 with master 7a987ba24 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Slowest function optimization changes (ThinLTO)

Median per-function time ratio to the master baseline: programs/clickhouse ×0.61, programs/clickhouse-keeper ×0.74 (each binary is linked separately, on a different machine and with different build flags); deltas below are relative to it.

Binary Function Master PR Δ vs median
programs/clickhouse DB::registerFunctionConversion(DB::FunctionFactory&) 5.7 s 13.1 s +9.6 s (+277%)
programs/clickhouse _ZN6detail10static_forITk7is_enumN2DB23AttributeUnderlyingTypeEZNS1_29callOnDictionaryAttributeType… 3.4 s 7.6 s +5.5 s (+271%)
Compile time of recompiled translation units

7 translation units recompiled, 6 s compile time in total, 7 of them have a recent master baseline.

Job report

@azat
azat enabled auto-merge November 13, 2026 07:49
@azat
azat added this pull request to the merge queue Nov 13, 2026
Merged via the queue into ClickHouse:master with commit 777dc4a Nov 13, 2026
204 checks passed
@azat
azat deleted the fix-numeric-quoted-type-name branch November 13, 2026 09:03
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-sql-syntax SQL/grammar parsing, AST nodes, syntax-level features. 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.

3 participants