Repository navigation
Fix logical error when a lambda argument is a backquoted dotted identifier - #108735
alexey-milovidov merged 5 commits into
Conversation
…ifier
A lambda argument name is an atomic identifier (the query tree builder
validates it consists of a single AST identifier part). LambdaNode built
the argument IdentifierNode via Identifier{name}, which uses the
split-on-dot Identifier(String) constructor. For a backquoted name that
contains a dot (e.g. `__table1.`) this split produced an empty trailing
part (["__table1", ""]). When the query tree was later converted back to
AST for an error message, the ASTIdentifier constructor asserted
!part.empty() and aborted the server in debug/sanitizer builds.
Build the argument Identifier from a single part so the atomic name is
not split. Resolution is unchanged because lambda arguments are bound by
the identifier full name, which is identical either way.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-3:20260628-100300 |
|
cc @novikd @vdimir — could you review this? A lambda argument is validated as a single identifier part, but |
|
Workflow [PR], commit [86f7932] Summary: ✅
AI ReviewSummaryThis PR fixes the analyzer's handling of backquoted lambda argument names that contain dots by preserving each argument as a single identifier part inside Final VerdictStatus: ✅ Approve |
CI finish ledger — 399d7a6Every failure below has an owner. Only
This PR's lambda-identifier fix is unrelated to the RefreshTask scheduling subsystem; the stress failure is a pre-existing trunk finding, not caused by this diff. Session id: cron:our-pr-ci-monitor:20260629-010000 |
vdimir
left a comment
There was a problem hiding this comment.
Thanks for taking the time to improve the project!
Pick up the revert of ClickHouse#105591 (vector-search rescoring row-positioning) so 02354_vector_search_rescoring passes. The prior branch base predated the revert and carried the reverted-then-broken change, causing 02354 to fail across every sanitizer variant (a stale-base reintroduction of a reverted master bug, not caused by this LambdaNode fix).
CI finish ledger — 5728754CI fully finished on this head. Every failure has an owner.
The LambdaNode backquoted-dotted-identifier fix (STID 2508-2ef2) and its regression test are unchanged and intact after the merge (net src delta vs master = only Session id: cron:our-pr-ci-monitor:20260704-180000 |
CI finish ledger — 089c985CI fully finished on this head (the master-merge that picked up the reverted
None of these are PR-caused: this PR changes one line in Session id: cron:our-pr-ci-monitor:20260704-223000 |
Ledger update —
|
|
@groeneai, the failed tests were fixed on master. Please update the branch. |
…mpty-part-lambda-arg
|
Branch updated onto current master (891c628). CI re-running. |
CI finish ledger — 891c628Every failure below has an owner. Only
Not PR-caused: this PR only changes Session id: cron:our-pr-ci-monitor:20260714-070000 |
…mpty-part-lambda-arg
|
Branch updated onto current master (86f7932); the |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 5/5 (100.00%) · Uncovered code |
…empty-part-lambda-arg Fix logical error when a lambda argument is a backquoted dotted identifier
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a logical error (
!part.empty()) when a lambda argument is a backquoted identifier whose name contains a dot (for example a lambda argument named__table1.). Such a query previously produced a handled exception in release builds and aborted the server in debug and sanitizer builds while formatting an error message.Description
A lambda argument name is an atomic identifier: the query tree builder (
QueryTreeBuilder) validates that it consists of a single AST identifier part.LambdaNodethen built the argumentIdentifierNodeviaIdentifier{name}, which invokes the split-on-dotIdentifier(String)constructor. For a backquoted name containing a dot this split produced an empty trailing part (["__table1", ""]), inconsistent with the single-part origin.When the query tree was later converted back to AST for an error message (for example a
TYPE_MISMATCHwhile validating a columnALIASwhose declared type does not match the lambda expression),IdentifierNode::toASTImplreconstructed anASTIdentifierfrom those parts and theASTIdentifierconstructor asserted!part.empty(), aborting the server in debug and sanitizer builds.The fix builds the argument
Identifierfrom a single part so the atomic name is not split. Resolution is unchanged: lambda arguments are bound by the identifier full name, which is identical either way.Found by the targeted AST fuzzer (STID 2508-2ef2,
Logical error: '!part.empty()'). The bug is pre-existing and independent of any specific PR. It reproduces deterministically:No related open issue found.
Regression test:
tests/queries/0_stateless/04367_lambda_arg_backquoted_dot_no_logical_error.sql.Version info
26.7.1.1304(included in26.7and later)