From f30edaf56347c52182425cc5372570d920548249 Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Fri, 6 Jan 2017 14:25:55 -0500 Subject: [PATCH 1/3] Silence another deprecation reexport warning. --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index e2dec86..905462b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,6 +90,7 @@ pub use error::Error; pub use cache::CachedStatement; #[cfg(feature = "load_extension")] +#[allow(deprecated)] pub use load_extension_guard::{SqliteLoadExtensionGuard, LoadExtensionGuard}; pub mod types; From 67092074538f7658b256f8e1f5e34abde959a46a Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Fri, 6 Jan 2017 14:32:27 -0500 Subject: [PATCH 2/3] Fix close() returning a useful connection on failure. --- src/lib.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e2dec86..b0ccaa9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -608,8 +608,11 @@ impl InnerConnection { fn close(&mut self) -> Result<()> { unsafe { let r = ffi::sqlite3_close(self.db()); - self.db = ptr::null_mut(); - self.decode_result(r) + let r = self.decode_result(r); + if r.is_ok() { + self.db = ptr::null_mut(); + } + r } } @@ -1277,13 +1280,14 @@ mod test { raw_stmt }; - let result = db.close(); - assert!(result.is_err()); + // now that we have an open statement, trying (and retrying) to close should fail. + let (db, _) = db.close().unwrap_err(); + let (db, _) = db.close().unwrap_err(); + let (db, _) = db.close().unwrap_err(); - // finalize the open statement so a second close will succeed + // finalize the open statement so a final close will succeed assert_eq!(ffi::SQLITE_OK, unsafe { ffi::sqlite3_finalize(raw_stmt) }); - let (db, _) = result.unwrap_err(); db.close().unwrap(); } From efaa5e5d0023e99a36ab700e7610b8c5fdb1f0ba Mon Sep 17 00:00:00 2001 From: gwenn Date: Fri, 13 Jan 2017 21:16:31 +0100 Subject: [PATCH 3/3] Upgrade serde, lazy-static and regexp dependencies --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 42531c9..f3a8d8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,12 +26,12 @@ bitflags = "0.7" lru-cache = "0.1.0" libc = "~0.2" chrono = { version = "~0.2", optional = true } -serde_json = { version = "0.6", optional = true } +serde_json = { version = "0.8", optional = true } [dev-dependencies] tempdir = "~0.3.4" -lazy_static = "~0.1" -regex = "~0.1.41" +lazy_static = "~0.2" +regex = "~0.2" [dependencies.libsqlite3-sys] path = "libsqlite3-sys"