pass correct change schema to step rollback

This commit is contained in:
pedrocarlo 2025-07-04 12:01:56 -03:00
parent 7ec47e90cc
commit b69472b5a3
2 changed files with 13 additions and 2 deletions

View file

@ -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>;

View file

@ -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 => {}