mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
Fix regressions
This commit is contained in:
parent
d72c4582d9
commit
b8594a0f83
@ -411,7 +411,7 @@ impl<'conn> Statement<'conn> {
|
||||
#[cfg(feature = "array")]
|
||||
ToSqlOutput::Array(a) => {
|
||||
return self.conn
|
||||
.decode_result(unsafe { ffi::sqlite3_bind_pointer(ptr, col, Rc::into_raw(a) as *mut c_void, ARRAY_TYPE, Some(free_array)) });
|
||||
.decode_result(unsafe { ffi::sqlite3_bind_pointer(ptr, col as c_int, Rc::into_raw(a) as *mut c_void, ARRAY_TYPE, Some(free_array)) });
|
||||
}
|
||||
};
|
||||
self.conn
|
||||
|
@ -364,7 +364,7 @@ mod test {
|
||||
}
|
||||
|
||||
let ids: Result<Vec<i32>> = s
|
||||
.query_map(&[], |row| row.get::<i32, i32>(0))
|
||||
.query_map(&[], |row| row.get::<_, i32>(0))
|
||||
.unwrap()
|
||||
.collect();
|
||||
let sum = ids.unwrap().iter().fold(0, |acc, &id| acc + id);
|
||||
@ -389,7 +389,7 @@ mod test {
|
||||
|
||||
let mut rows = s.query(&[]).unwrap();
|
||||
let row = rows.next().unwrap().unwrap();
|
||||
assert_eq!(row.get::<i32, i32>(0), 2);
|
||||
assert_eq!(row.get::<_, i32>(0), 2);
|
||||
}
|
||||
db.execute_batch("DROP TABLE vtab").unwrap();
|
||||
}
|
||||
|
@ -180,8 +180,8 @@ mod test {
|
||||
s.query_map(&[], |row| {
|
||||
let i1: i64 = row.get(0);
|
||||
assert!(i1 == 1 || i1 == 3);
|
||||
assert_eq!(11, row.get::<i32, i32>(1));
|
||||
assert_eq!(-5, row.get::<i32, i32>(2));
|
||||
assert_eq!(11, row.get::<_, i32>(1));
|
||||
assert_eq!(-5, row.get::<_, i32>(2));
|
||||
}).unwrap();
|
||||
}
|
||||
|
||||
@ -195,9 +195,9 @@ mod test {
|
||||
{
|
||||
let mut rows = s.query(&[]).unwrap();
|
||||
let row = rows.next().unwrap().unwrap();
|
||||
assert_eq!(1, row.get::<i32, i32>(0));
|
||||
assert_eq!(11, row.get::<i32, i32>(1));
|
||||
assert_eq!(-5, row.get::<i32, i32>(2));
|
||||
assert_eq!(1, row.get::<_, i32>(0));
|
||||
assert_eq!(11, row.get::<_, i32>(1));
|
||||
assert_eq!(-5, row.get::<_, i32>(2));
|
||||
}
|
||||
|
||||
p2.borrow_mut().clear();
|
||||
|
@ -235,7 +235,7 @@ impl<'a> Values<'a> {
|
||||
FromSqlError::Other(err) => {
|
||||
Error::FromSqlConversionFailure(idx, value.data_type(), err)
|
||||
}
|
||||
FromSqlError::OutOfRange(i) => Error::IntegralValueOutOfRange(idx as c_int, i),
|
||||
FromSqlError::OutOfRange(i) => Error::IntegralValueOutOfRange(idx, i),
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -280,7 +280,7 @@ mod test {
|
||||
|
||||
let mut s = db.prepare("SELECT * FROM generate_series(0,20,5)").unwrap();
|
||||
|
||||
let series = s.query_map(&[], |row| row.get::<i32, i32>(0)).unwrap();
|
||||
let series = s.query_map(&[], |row| row.get::<_, i32>(0)).unwrap();
|
||||
|
||||
let mut expected = 0;
|
||||
for value in series {
|
||||
|
Loading…
Reference in New Issue
Block a user