mirror of
https://github.com/isar/rusqlite.git
synced 2025-03-25 23:06:04 +08:00
Merge pull request #1633 from gwenn/array
Use decrement_strong_count directly for Array
This commit is contained in:
commit
eeece2f0ee
@ -61,11 +61,11 @@ unlock_notify = ["libsqlite3-sys/unlock_notify"]
|
||||
vtab = []
|
||||
csvtab = ["csv", "vtab"]
|
||||
# pointer passing interfaces: 3.20.0
|
||||
array = ["vtab"]
|
||||
array = ["vtab", "modern_sqlite"]
|
||||
# session extension: 3.13.0
|
||||
session = ["libsqlite3-sys/session", "hooks"]
|
||||
# window functions: 3.25.0
|
||||
window = ["functions"]
|
||||
window = ["functions", "modern_sqlite"]
|
||||
# 3.9.0
|
||||
series = ["vtab"]
|
||||
# check for invalid query.
|
||||
|
@ -60,16 +60,8 @@ impl Sql {
|
||||
let value = match value {
|
||||
ToSqlOutput::Borrowed(v) => v,
|
||||
ToSqlOutput::Owned(ref v) => ValueRef::from(v),
|
||||
#[cfg(feature = "blob")]
|
||||
ToSqlOutput::ZeroBlob(_) => {
|
||||
return Err(err!(ffi::SQLITE_MISUSE, "Unsupported value \"{value:?}\""));
|
||||
}
|
||||
#[cfg(feature = "functions")]
|
||||
ToSqlOutput::Arg(_) => {
|
||||
return Err(err!(ffi::SQLITE_MISUSE, "Unsupported value \"{value:?}\""));
|
||||
}
|
||||
#[cfg(feature = "array")]
|
||||
ToSqlOutput::Array(_) => {
|
||||
#[cfg(any(feature = "blob", feature = "functions", feature = "array"))]
|
||||
_ => {
|
||||
return Err(err!(ffi::SQLITE_MISUSE, "Unsupported value \"{value:?}\""));
|
||||
}
|
||||
};
|
||||
|
@ -43,7 +43,7 @@ use crate::{Connection, Result};
|
||||
pub(crate) const ARRAY_TYPE: *const c_char = c"rarray".as_ptr();
|
||||
|
||||
pub(crate) unsafe extern "C" fn free_array(p: *mut c_void) {
|
||||
drop(Rc::from_raw(p as *const Vec<Value>));
|
||||
Rc::decrement_strong_count(p as *const Vec<Value>);
|
||||
}
|
||||
|
||||
/// Array parameter / pointer
|
||||
|
Loading…
x
Reference in New Issue
Block a user