Merge pull request #1633 from gwenn/array

Use decrement_strong_count directly for Array
This commit is contained in:
gwenn 2025-02-01 11:12:10 +01:00 committed by GitHub
commit eeece2f0ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 13 deletions

View File

@ -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.

View File

@ -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:?}\""));
}
};

View File

@ -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