We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 546564f + 6c416b6 commit 7b5089aCopy full SHA for 7b5089a
1 file changed
src/vfs.rs
@@ -421,6 +421,13 @@ unsafe extern "C" fn x_open<T: Vfs>(
421
flags: c_int,
422
p_out_flags: *mut c_int,
423
) -> c_int {
424
+ // From https://sqlite.org/c3ref/vfs.html:
425
+ // "Note that the xOpen method must set the sqlite3_file.pMethods to either a valid
426
+ // sqlite3_io_methods object or to NULL. xOpen must do this even if the open fails."
427
+ if let Some(f) = unsafe { p_file.as_mut() } {
428
+ f.pMethods = core::ptr::null();
429
+ }
430
+
431
fallible(|| {
432
let opts = flags.into();
433
let name = unsafe { lossy_cstr(z_name) }.ok();
0 commit comments