Commit 49950e4
endtoend: pin sqlite query text with multi-byte UTF-8 comments (#4568)
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
Claude-Session: https://claude.ai/code/session_017bkCyEYanANjRyamjUF8ZP
Co-authored-by: Claude <noreply@anthropic.com>1 parent e76cf63 commit 49950e4
6 files changed
Lines changed: 164 additions & 0 deletions
File tree
- internal/endtoend/testdata/multibyte_comment/sqlite
- go
Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments