mirror of
https://github.com/isar/rusqlite.git
synced 2025-03-26 15:26:03 +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 = []
|
vtab = []
|
||||||
csvtab = ["csv", "vtab"]
|
csvtab = ["csv", "vtab"]
|
||||||
# pointer passing interfaces: 3.20.0
|
# pointer passing interfaces: 3.20.0
|
||||||
array = ["vtab"]
|
array = ["vtab", "modern_sqlite"]
|
||||||
# session extension: 3.13.0
|
# session extension: 3.13.0
|
||||||
session = ["libsqlite3-sys/session", "hooks"]
|
session = ["libsqlite3-sys/session", "hooks"]
|
||||||
# window functions: 3.25.0
|
# window functions: 3.25.0
|
||||||
window = ["functions"]
|
window = ["functions", "modern_sqlite"]
|
||||||
# 3.9.0
|
# 3.9.0
|
||||||
series = ["vtab"]
|
series = ["vtab"]
|
||||||
# check for invalid query.
|
# check for invalid query.
|
||||||
|
@ -60,16 +60,8 @@ impl Sql {
|
|||||||
let value = match value {
|
let value = match value {
|
||||||
ToSqlOutput::Borrowed(v) => v,
|
ToSqlOutput::Borrowed(v) => v,
|
||||||
ToSqlOutput::Owned(ref v) => ValueRef::from(v),
|
ToSqlOutput::Owned(ref v) => ValueRef::from(v),
|
||||||
#[cfg(feature = "blob")]
|
#[cfg(any(feature = "blob", feature = "functions", feature = "array"))]
|
||||||
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(_) => {
|
|
||||||
return Err(err!(ffi::SQLITE_MISUSE, "Unsupported value \"{value:?}\""));
|
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) const ARRAY_TYPE: *const c_char = c"rarray".as_ptr();
|
||||||
|
|
||||||
pub(crate) unsafe extern "C" fn free_array(p: *mut c_void) {
|
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
|
/// Array parameter / pointer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user