Savepoint Drop bug

See https://github.com/rusqlite/rusqlite/pull/1327#issuecomment-1586618034
This commit is contained in:
gwenn 2023-06-12 19:16:10 +02:00
parent 841014bfd1
commit 5707efd232

View File

@ -686,6 +686,22 @@ mod test {
Ok(()) Ok(())
} }
#[test]
fn test_savepoint_release_error() -> Result<()> {
let mut db = checked_memory_handle()?;
db.pragma_update(None, "foreign_keys", true)?;
db.execute_batch("CREATE TABLE r(n INTEGER PRIMARY KEY NOT NULL); CREATE TABLE f(n REFERENCES r(n) DEFERRABLE INITIALLY DEFERRED);")?;
{
let mut sp = db.savepoint()?;
sp.execute("INSERT INTO f VALUES (0)", [])?;
sp.set_drop_behavior(DropBehavior::Commit);
}
assert!(db.is_autocommit());
Ok(())
}
#[test] #[test]
fn test_savepoint_names() -> Result<()> { fn test_savepoint_names() -> Result<()> {
let mut db = checked_memory_handle()?; let mut db = checked_memory_handle()?;