Commit 162156f
Pin _is_multi_statement consecutive-semicolon walker behaviour
cursor.py:526-535 walks past consecutive ``;`` and trailing
comments to classify SQL as single- vs multi-statement. The
walker is the security guard preventing stacked-query smuggling
into dqlite's prepare path (which silently drops everything past
the first ``;``).
Pin the actual current contract:
- ``INSERT ...;;`` → multi (conservative)
- ``INSERT ...; -- comment\n;`` → multi (conservative)
- ``INSERT ...; /* */ ;`` → multi (conservative)
- ``INSERT ...;`` + whitespace / comments only → NOT multi
The conservative classification on ``;;`` is the safer arm: a
false-negative would smuggle a stacked second statement; a
false-positive only rejects valid-but-unusual SQL with diagnostic.
Companion to the existing leading-semicolon and tracker-desync
coverage; this test exercises the trailing-walker arm directly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e1f4ad8 commit 162156f
1 file changed
Lines changed: 61 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 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments