mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
Merge pull request #974 from gwenn/inner
Fix InnerConnection decode_result / changes
This commit is contained in:
commit
34c9aed592
@ -223,7 +223,7 @@ impl Connection {
|
|||||||
row_id: i64,
|
row_id: i64,
|
||||||
read_only: bool,
|
read_only: bool,
|
||||||
) -> Result<Blob<'a>> {
|
) -> Result<Blob<'a>> {
|
||||||
let mut c = self.db.borrow_mut();
|
let c = self.db.borrow_mut();
|
||||||
let mut blob = ptr::null_mut();
|
let mut blob = ptr::null_mut();
|
||||||
let db = db.as_cstring()?;
|
let db = db.as_cstring()?;
|
||||||
let table = super::str_to_cstring(table)?;
|
let table = super::str_to_cstring(table)?;
|
||||||
|
@ -64,7 +64,7 @@ impl Connection {
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut c = self.db.borrow_mut();
|
let c = self.db.borrow_mut();
|
||||||
let r = match callback {
|
let r = match callback {
|
||||||
Some(f) => unsafe {
|
Some(f) => unsafe {
|
||||||
ffi::sqlite3_busy_handler(c.db(), Some(busy_handler_callback), f as *mut c_void)
|
ffi::sqlite3_busy_handler(c.db(), Some(busy_handler_callback), f as *mut c_void)
|
||||||
|
@ -136,7 +136,7 @@ impl InnerConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn decode_result(&mut self, code: c_int) -> Result<()> {
|
pub fn decode_result(&self, code: c_int) -> Result<()> {
|
||||||
unsafe { InnerConnection::decode_result_raw(self.db(), code) }
|
unsafe { InnerConnection::decode_result_raw(self.db(), code) }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ impl InnerConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn changes(&mut self) -> usize {
|
pub fn changes(&self) -> usize {
|
||||||
unsafe { ffi::sqlite3_changes(self.db()) as usize }
|
unsafe { ffi::sqlite3_changes(self.db()) as usize }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -832,7 +832,7 @@ impl Connection {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn decode_result(&self, code: c_int) -> Result<()> {
|
fn decode_result(&self, code: c_int) -> Result<()> {
|
||||||
self.db.borrow_mut().decode_result(code)
|
self.db.borrow().decode_result(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the number of rows modified, inserted or deleted by the most
|
/// Return the number of rows modified, inserted or deleted by the most
|
||||||
@ -840,7 +840,7 @@ impl Connection {
|
|||||||
/// connection.
|
/// connection.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn changes(&self) -> usize {
|
fn changes(&self) -> usize {
|
||||||
self.db.borrow_mut().changes()
|
self.db.borrow().changes()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Test for auto-commit mode.
|
/// Test for auto-commit mode.
|
||||||
|
Loading…
Reference in New Issue
Block a user