mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
pass correct change schema to step rollback
This commit is contained in:
parent
7ec47e90cc
commit
b69472b5a3
2 changed files with 13 additions and 2 deletions
11
core/lib.rs
11
core/lib.rs
|
@ -102,6 +102,17 @@ enum TransactionState {
|
|||
None,
|
||||
}
|
||||
|
||||
impl TransactionState {
|
||||
fn change_schema(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
TransactionState::Write {
|
||||
change_schema: true
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) type MvStore = mvcc::MvStore<mvcc::LocalClock>;
|
||||
|
||||
pub(crate) type MvCursor = mvcc::cursor::ScanCursor<mvcc::LocalClock>;
|
||||
|
|
|
@ -384,8 +384,8 @@ impl Program {
|
|||
trace_insn(self, state.pc as InsnReference, insn);
|
||||
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)?
|
||||
let state = self.connection.transaction_state.get();
|
||||
pager.rollback(state.change_schema(), &self.connection)?
|
||||
}
|
||||
match res? {
|
||||
InsnFunctionStepResult::Step => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue