mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 07:09:20 +08:00
Savepoint Drop bug
See https://github.com/rusqlite/rusqlite/pull/1327#issuecomment-1586618034
This commit is contained in:
parent
841014bfd1
commit
5707efd232
@ -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()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user