Repository navigation
fix: bind complete named parameters containing dollar signs - #2030
Conversation
|
still current with main, ptal |
🤖 Claude reviewAdds What I checked:
Behavior change to know: Blind spots:
Verdict: ✅ Approve Inline comments are attached to the relevant lines. This summary updates in place on re-review. |
Move the unit cases into bind_test.go next to the other named bind tests and drop the subtests that pass without the fix. Use TestProtocols and one helper in the issue test, and check the client error text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI review gate — Human approval in place of AI reviewApproved on the head commit by joe-clickhouse (write access, not the author), standing in for the AI review:
What to do:
Evaluated at |
|
Thanks! Looks good. The server reads I pushed a small cleanup of the tests. The unit cases now live in |
polyglotAI-bot
left a comment
There was a problem hiding this comment.
Approve: no blocking problems and no inline comments.
- The new tests fail with the
bind.goofmainand pass on this head: 7 unit subtests and 10 server cases, ClickHouse 26.10.4. - A differential run of the old and new
bindNamedon 300,000 random queries changed the output only where an@nameis next to a$. - ClickHouse 26.10.4 reads
id$xand$xas one name, so the placeholder now ends where the server's name ends.
There was a problem hiding this comment.
Co-signing @joe-clickhouse's approval of cbf4f1c: the AI review gate is green on this commit.
Fixes #1955.
Recognize
$inside client-side@nameplaceholders. This prevents@id$xfrom selectingidand leaving$xin the query, and restores missing-parameter errors for the complete name.Adds unit coverage for leading, trailing, repeated and digit-adjacent dollar signs, quotes/comments, missing names and
DateNamed; adds real-server tests for native/HTTP and direct/database/sqlAPIs.Validation: run 35297161774.
AI tools assisted with implementation, validation and this description.
Note
Low Risk
Small, targeted change to named-placeholder parsing plus tests; no auth or data-path redesign.
Overview
Fixes client-side
@namebinding when parameter names include$, which ClickHouse allows but the binder previously rejected after the first invalid character (e.g.@id$xbound as@idand left$xin the SQL).isNameCharnow treats$as part of a named placeholder so the scanner consumes the full name, substitutes values correctly, and still errors when the complete name is missing.Adds
TestBindNamedDollar(edge cases, quotes/comments,DateNamed) andTest1955integration coverage for native/HTTP anddatabase/sqlpaths.Reviewed by Cursor Bugbot for commit cbf4f1c. Bugbot is set up for automated code reviews on this repo. Configure here.