Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Queries that reference legal unquoted PostgreSQL names such as
value$1orvalue$tag$work with extended protocol but fail withQueryExecModeSimpleProtocol. The SQL sanitizer treats a dollar suffix inside the name as a parameter or a dollar-quote opener, causing syntax errors, insufficient arguments or unused-argument errors.Consume each complete unquoted identifier before looking for the next SQL token, matching the existing NamedArgs lexer. PostgreSQL allows dollar signs after the first identifier character. The actual parameter following the identifier continues to bind normally; the public API and dependencies are unchanged.
Validation:
0b03cad, four simple-protocol cases fail against PostgreSQL 18.6; the identical four extended-protocol controls pass. All eight pass after the fix, along with four exact-SQL sanitizer regressions.go test -race ./...passes against PostgreSQL 18.6, including existing dollar-quote and sanitizer regressions. Optional TLS/auth/PgBouncer/CockroachDB configurations and the full OS/Go/database matrix were not run.go vet . ./internal/sanitizepasses. Whole-repository vet reports the same 117 pre-existing unkeyed-literal diagnostics in pgtype on pristine master and the patch.pgconn/auth_policy_test.go:316,pgtype/multirange.go:390); checking new issues reports zero.AI proposal: prepared by Codex (GPT-6). The task prompt was to find an independent backend bug, check existing issues/PRs/commits, reproduce it before changing production, implement a minimal fix and validate it. The investigation compared the two SQL lexers, exercised both protocols against a real database, and reviewed the complete final diff.