mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-14 12:34:20 +01:00
op_transaction: read tx must be ended in all cases if begin_write_tx fails
This commit is contained in:
@@ -2030,12 +2030,7 @@ pub fn op_transaction(
|
||||
match pager.begin_write_tx()? {
|
||||
IOResult::Done(r) => {
|
||||
if let LimboResult::Busy = r {
|
||||
if matches!(
|
||||
current_state,
|
||||
TransactionState::Read | TransactionState::PendingUpgrade
|
||||
) {
|
||||
pager.end_read_tx()?;
|
||||
}
|
||||
pager.end_read_tx()?;
|
||||
conn.transaction_state.replace(TransactionState::None);
|
||||
conn.auto_commit.replace(true);
|
||||
return Ok(InsnFunctionStepResult::Busy);
|
||||
|
||||
Reference in New Issue
Block a user