Fix Savepoint::drop

This commit is contained in:
gwenn 2023-06-12 19:23:06 +02:00
parent 5707efd232
commit 3e9e7fdc18

View File

@ -344,7 +344,7 @@ impl Savepoint<'_> {
return Ok(());
}
match self.drop_behavior() {
DropBehavior::Commit => self.commit_().or_else(|_| self.rollback()),
DropBehavior::Commit => self.commit_().or_else(|_| self.rollback().and_then(|_| self.commit_())),
DropBehavior::Rollback => self.rollback().and_then(|_| self.commit_()),
DropBehavior::Ignore => Ok(()),
DropBehavior::Panic => panic!("Savepoint dropped unexpectedly."),