mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
rollback transaction when we fail in step
This commit is contained in:
parent
897426a662
commit
9632ab0a41
2 changed files with 7 additions and 3 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue