mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 08:55:40 +01:00
rollback transaction when we fail in step
This commit is contained in:
@@ -1569,8 +1569,8 @@ pub fn begin_write_wal_frame(
|
||||
if res.is_err() {
|
||||
// If we do not reduce the counter here on error, we incur an infinite loop when cacheflushing
|
||||
*write_counter.borrow_mut() -= 1;
|
||||
res?;
|
||||
}
|
||||
res?;
|
||||
tracing::trace!("Frame written and synced");
|
||||
Ok(checksums)
|
||||
}
|
||||
|
||||
@@ -382,8 +382,12 @@ impl Program {
|
||||
let _ = state.result_row.take();
|
||||
let (insn, insn_function) = &self.insns[state.pc as usize];
|
||||
trace_insn(self, state.pc as InsnReference, insn);
|
||||
let res = insn_function(self, state, insn, &pager, mv_store.as_ref())?;
|
||||
match res {
|
||||
let res = insn_function(self, state, insn, &pager, mv_store.as_ref());
|
||||
if res.is_err() {
|
||||
// TODO: see change_schema correct value
|
||||
pager.rollback(false, &self.connection)?
|
||||
}
|
||||
match res? {
|
||||
InsnFunctionStepResult::Step => {}
|
||||
InsnFunctionStepResult::Done => return Ok(StepResult::Done),
|
||||
InsnFunctionStepResult::IO => return Ok(StepResult::IO),
|
||||
|
||||
Reference in New Issue
Block a user