diff --git a/core/storage/sqlite3_ondisk.rs b/core/storage/sqlite3_ondisk.rs index 3a9c98668..8cf56b574 100644 --- a/core/storage/sqlite3_ondisk.rs +++ b/core/storage/sqlite3_ondisk.rs @@ -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) } diff --git a/core/vdbe/mod.rs b/core/vdbe/mod.rs index 17d994b68..afb18a1eb 100644 --- a/core/vdbe/mod.rs +++ b/core/vdbe/mod.rs @@ -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),