Files
turso/core
Pekka Enberg 4bca5edb9e Merge 'Don't clear transaction state in nested statement' from Jussi Saurio
Closes #2738
Closes #2739
Closes #2753
Closes #2755
Closes #2767
Closes #2768
Closes #2769
Closes #2770
## El problema
If a connection does e.g. CREATE TABLE, it will start a "child
statement" to reparse the schema. That statement does not start its own
transaction, and so should not try to end the existing one either.
We had a logic bug where these steps would happen:
- `CREATE TABLE` executed successfully
- pread fault happens inside `ParseSchema` child stmt
- `handle_program_error()` is called
- `pager.end_tx()` returns immediately because `is_nested_stmt` is true
and we correctly no-op it.
- however, crucially: `handle_program_error()` then sets tx state to
None
- parent statement now catches error from nested stmt and calls
`handle_program_error()`, which calls `pager.end_tx()` again, and since
txn state is None, when it calls `rollback()` we panic on the assertion
`"dirty pages should be empty for read txn"`
## La solucion
Do not do _any_ error processing in `handle_program_error()` inside a
nested stmt. This means that the parent write txn is still active when
it processes the error from the child and we avoid this panic.

Closes #2772
2025-08-25 10:12:09 +03:00
..
2025-08-24 18:56:05 -04:00
2025-08-21 14:45:00 -04:00
2025-06-23 19:52:13 +01:00
2025-06-30 10:01:03 +03:00
2025-08-15 17:08:53 -04:00
2025-01-28 14:55:38 -05:00
2025-08-21 15:23:59 -03:00
2025-06-23 19:52:13 +01:00
2025-08-12 16:42:38 +05:30
2025-01-28 14:55:38 -05:00
2025-08-21 15:19:16 -03:00
2025-06-23 19:52:13 +01:00
2025-08-23 03:17:03 -05:00
2025-08-21 15:19:16 -03:00
2025-08-21 15:23:59 -03:00
2025-06-30 09:54:13 +03:00
2025-08-21 15:23:59 -03:00