mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 09:04:19 +01:00
Remove InsnFunctionStepResult::Busy
we don't need all these busy variants, let's just handle LimboError::Busy
This commit is contained in:
@@ -435,11 +435,6 @@ impl CompiledExpression {
|
||||
"Expression evaluation was interrupted".to_string(),
|
||||
));
|
||||
}
|
||||
crate::vdbe::execute::InsnFunctionStepResult::Busy => {
|
||||
return Err(crate::LimboError::InternalError(
|
||||
"Expression evaluation encountered busy state".to_string(),
|
||||
));
|
||||
}
|
||||
crate::vdbe::execute::InsnFunctionStepResult::Step => {
|
||||
pc = state.pc as usize;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,6 @@ pub enum InsnFunctionStepResult {
|
||||
IO(IOCompletions),
|
||||
Row,
|
||||
Interrupt,
|
||||
Busy,
|
||||
Step,
|
||||
}
|
||||
|
||||
@@ -2205,11 +2204,7 @@ pub fn op_transaction(
|
||||
!conn.is_nested_stmt.get(),
|
||||
"nested stmt should not begin a new read transaction"
|
||||
);
|
||||
let res = pager.begin_read_tx();
|
||||
if let Err(LimboError::Busy) = res {
|
||||
return Ok(InsnFunctionStepResult::Busy);
|
||||
}
|
||||
res?;
|
||||
let res = pager.begin_read_tx()?;
|
||||
}
|
||||
|
||||
if updated && matches!(new_transaction_state, TransactionState::Write { .. }) {
|
||||
@@ -2227,7 +2222,7 @@ pub fn op_transaction(
|
||||
conn.transaction_state.replace(TransactionState::None);
|
||||
}
|
||||
assert_eq!(conn.transaction_state.get(), current_state);
|
||||
return Ok(InsnFunctionStepResult::Busy);
|
||||
return Err(LimboError::Busy);
|
||||
}
|
||||
if let IOResult::IO(io) = begin_w_tx_res? {
|
||||
// set the transaction state to pending so we don't have to
|
||||
|
||||
@@ -675,7 +675,7 @@ impl Program {
|
||||
// Instruction interrupted - may resume at same PC
|
||||
return Ok(StepResult::Interrupt);
|
||||
}
|
||||
Ok(InsnFunctionStepResult::Busy) => {
|
||||
Err(LimboError::Busy) => {
|
||||
// Instruction blocked - will retry at same PC
|
||||
return Ok(StepResult::Busy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user