Skip to content

testdrive: fix --rewrite-results dropping bytes between commands#36489

Open
def- wants to merge 1 commit into
MaterializeInc:mainfrom
def-:pr-testdrive-rewrite-fix
Open

testdrive: fix --rewrite-results dropping bytes between commands#36489
def- wants to merge 1 commit into
MaterializeInc:mainfrom
def-:pr-testdrive-rewrite-fix

Conversation

@def-
Copy link
Copy Markdown
Contributor

@def- def- commented May 10, 2026

parse_sql and parse_explain_sql captured expected_end from LineReader::raw_pos, but peek() had already advanced raw_pos past the blank separator and the next command's query line. Rewrites of any non-last command silently dropped those bytes. Track a separate consumed_raw_pos that only advances when a line is actually returned to an external caller.

`parse_sql` and `parse_explain_sql` captured `expected_end` from
`LineReader::raw_pos`, but `peek()` had already advanced `raw_pos` past
the blank separator and the next command's query line. Rewrites of any
non-last command silently dropped those bytes. Track a separate
`consumed_raw_pos` that only advances when a line is actually returned
to an external caller.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@def- def- requested a review from bosconi May 10, 2026 15:24
@def- def- requested a review from a team as a code owner May 10, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant