add test for savepoint Commit or Rollback release

After a top-level savepoint exits on non-Ignore, the savepoint should
not be left on the stack.
This commit is contained in:
Taylor C. Richberger 2023-06-07 13:59:08 -06:00
parent 88653ca62a
commit 8545c5d011

View File

@ -668,6 +668,24 @@ mod test {
Ok(())
}
#[test]
fn test_savepoint_drop_behavior_releases() -> Result<()> {
let mut db = checked_memory_handle()?;
{
let mut sp = db.savepoint()?;
sp.set_drop_behavior(DropBehavior::Commit);
}
assert!(db.is_autocommit());
{
let mut sp = db.savepoint()?;
sp.set_drop_behavior(DropBehavior::Rollback);
}
assert!(db.is_autocommit());
Ok(())
}
#[test]
fn test_savepoint_names() -> Result<()> {
let mut db = checked_memory_handle()?;