Files
turso/core
Jussi Saurio 809c89b1c4 Merge 'core/vdbe: resume the commit when RELEASE re-enters after I/O' from app/turso-github-handyman
In MVCC mode with `PRAGMA mvcc_checkpoint_threshold = 0`, releasing the
outer savepoint reported an error even though the transaction was
committed. An application that retried after the error wrote the rows
twice.

```sql
PRAGMA journal_mode='mvcc';
PRAGMA mvcc_checkpoint_threshold = 0;
CREATE TABLE a(id INTEGER PRIMARY KEY, v TEXT);
SAVEPOINT s1;
INSERT INTO a(v) VALUES ('x');
RELEASE s1;            -- before: Transaction error: no such savepoint: s1
SELECT count(*) FROM a; -- 1
```

`RELEASE` removes the savepoint and then commits through
`op_auto_commit`. With threshold 0, that commit runs a checkpoint, which
waits on I/O. When the instruction runs again, `RELEASE` looked up the
savepoint from the start, but the savepoint was already removed, so it
returned `NotFound`.

Now, if a commit is already in progress when `RELEASE` runs, it goes
straight back to `op_auto_commit` to finish that commit.
`op_auto_commit` already handles resuming a commit this way.

Fixes #9748

Autofixer wrote this change with Claude Code in an isolated sandbox. A
separate verifier agent tested and reviewed it in its own container
before this PR was opened. A maintainer must review it before merge.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #9762
2026-10-12 16:13:06 +03:00
..
…
…
…
…
…
…
2026-10-05 15:52:51 +03:00
…
…
…
…
…
…
…
…