mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-24 21:52:41 +08:00
pragma_update fails with ExecuteReturnedResults
Ideally, while executing a batch, we should fail if it contains a SELECT statement. But currently there is no way to make the distinction between a SELECT and a PRAGMA which both updates and returns a row. So we fail only when `extra_check` feature is activated.
This commit is contained in:
@@ -430,4 +430,15 @@ mod test {
|
||||
sql.push_string_literal("value'; --");
|
||||
assert_eq!("'value''; --'", sql.as_str());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn locking_mode() {
|
||||
let db = Connection::open_in_memory().unwrap();
|
||||
let r = db.pragma_update(None, "locking_mode", &"exclusive");
|
||||
if cfg!(feature = "extra_check") {
|
||||
r.unwrap_err();
|
||||
} else {
|
||||
r.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user