Skip to content

endtoend: pin sqlite query text with multi-byte UTF-8 comments - #4568

Merged
kyleconroy merged 1 commit into
mainfrom
claude/meyer-parser-issue-saz9kh
Aug 18, 2026
Merged

endtoend: pin sqlite query text with multi-byte UTF-8 comments#4568
kyleconroy merged 1 commit into
mainfrom
claude/meyer-parser-issue-saz9kh

Conversation

@kyleconroy

Copy link
Copy Markdown
Collaborator

The ANTLR-based sqlite parser mixed rune-counted and byte-counted offsets when slicing query text out of the source file, so a multi-byte UTF-8 character in a comment silently truncated the generated query string and leaked fragments of neighboring statements into it. Switching to the meyer parser (#4535) fixed this — verified by running the reproduction from #4523 at 98ef75d~1 (truncated, with stray statement fragments) and at HEAD (byte-for-byte correct).

Nothing in the end-to-end corpus contained any non-ASCII SQL, so the fix had no regression coverage. This adds a sqlite case covering the three reported shapes:

The case passes in the base context and the opt-in core context.

Fixes #4523
Fixes #4235
Fixes #4372

🤖 Generated with Claude Code

https://claude.ai/code/session_017bkCyEYanANjRyamjUF8ZP


Generated by Claude Code

The ANTLR-based sqlite parser mixed rune-counted and byte-counted
offsets when slicing query text out of the source file, so a multi-byte
character in a comment silently truncated the generated query string
and leaked fragments of neighboring statements into it. The meyer
parser tracks byte offsets throughout, which fixed this; this case
keeps it fixed.

Covers the three reported shapes: an em dash in a comment directly
above the annotation, a standalone comment between two queries, and
CJK comments.

Fixes #4523
Fixes #4235
Fixes #4372

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017bkCyEYanANjRyamjUF8ZP
@kyleconroy
kyleconroy merged commit 49950e4 into main Aug 18, 2026
13 checks passed
@kyleconroy
kyleconroy deleted the claude/meyer-parser-issue-saz9kh branch August 18, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants