mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 17:14:20 +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(),
|
"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 => {
|
crate::vdbe::execute::InsnFunctionStepResult::Step => {
|
||||||
pc = state.pc as usize;
|
pc = state.pc as usize;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ pub enum InsnFunctionStepResult {
|
|||||||
IO(IOCompletions),
|
IO(IOCompletions),
|
||||||
Row,
|
Row,
|
||||||
Interrupt,
|
Interrupt,
|
||||||
Busy,
|
|
||||||
Step,
|
Step,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2205,11 +2204,7 @@ pub fn op_transaction(
|
|||||||
!conn.is_nested_stmt.get(),
|
!conn.is_nested_stmt.get(),
|
||||||
"nested stmt should not begin a new read transaction"
|
"nested stmt should not begin a new read transaction"
|
||||||
);
|
);
|
||||||
let res = pager.begin_read_tx();
|
let res = pager.begin_read_tx()?;
|
||||||
if let Err(LimboError::Busy) = res {
|
|
||||||
return Ok(InsnFunctionStepResult::Busy);
|
|
||||||
}
|
|
||||||
res?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if updated && matches!(new_transaction_state, TransactionState::Write { .. }) {
|
if updated && matches!(new_transaction_state, TransactionState::Write { .. }) {
|
||||||
@@ -2227,7 +2222,7 @@ pub fn op_transaction(
|
|||||||
conn.transaction_state.replace(TransactionState::None);
|
conn.transaction_state.replace(TransactionState::None);
|
||||||
}
|
}
|
||||||
assert_eq!(conn.transaction_state.get(), current_state);
|
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? {
|
if let IOResult::IO(io) = begin_w_tx_res? {
|
||||||
// set the transaction state to pending so we don't have to
|
// 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
|
// Instruction interrupted - may resume at same PC
|
||||||
return Ok(StepResult::Interrupt);
|
return Ok(StepResult::Interrupt);
|
||||||
}
|
}
|
||||||
Ok(InsnFunctionStepResult::Busy) => {
|
Err(LimboError::Busy) => {
|
||||||
// Instruction blocked - will retry at same PC
|
// Instruction blocked - will retry at same PC
|
||||||
return Ok(StepResult::Busy);
|
return Ok(StepResult::Busy);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user