diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 65dc01dc..1066cad1 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -38,7 +38,7 @@ jobs: name: Download duckdb with: repository: "duckdb/duckdb" - tag: "v0.9.1" + tag: "v0.9.2" fileName: ${{ matrix.duckdb }} out-file-path: . diff --git a/Cargo.toml b/Cargo.toml index d58b83f8..4a472d7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "duckdb" -version = "0.9.1" +version = "0.9.2" authors = ["wangfenjin "] edition = "2021" description = "Ergonomic wrapper for DuckDB" @@ -79,7 +79,7 @@ polars-core = "0.35.4" [dependencies.libduckdb-sys] path = "libduckdb-sys" -version = "0.9.1" +version = "0.9.2" [package.metadata.docs.rs] features = [] diff --git a/README.md b/README.md index 0a9e9b1a..243a6324 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,8 @@ You can adjust this behavior in a number of ways: This is probably the simplest solution to any build problems. You can enable this by adding the following in your `Cargo.toml` file: ```toml [dependencies] - # Assume that version DuckDB version 0.9.1 is used. - duckdb = { version = "0.9.1", features = ["bundled"] } + # Assume that version DuckDB version 0.9.2 is used. + duckdb = { version = "0.9.2", features = ["bundled"] } ``` * When linking against a DuckDB library already on the system (so *not* using any of the `bundled` features), you can set the `DUCKDB_LIB_DIR` environment variable to point to a directory containing the library. You can also set the `DUCKDB_INCLUDE_DIR` variable to point to the directory containing `duckdb.h`. * Installing the duckdb development packages will usually be all that is required, but diff --git a/libduckdb-sys/Cargo.toml b/libduckdb-sys/Cargo.toml index 63b524ab..189093c7 100644 --- a/libduckdb-sys/Cargo.toml +++ b/libduckdb-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libduckdb-sys" -version = "0.9.1" +version = "0.9.2" authors = ["wangfenjin "] edition = "2021" build = "build.rs" diff --git a/libduckdb-sys/build.rs b/libduckdb-sys/build.rs index d9876d3e..183007b0 100644 --- a/libduckdb-sys/build.rs +++ b/libduckdb-sys/build.rs @@ -323,7 +323,7 @@ mod bindings { bindgen::builder() .trust_clang_mangling(false) .header(header.clone()) - .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .generate() .unwrap_or_else(|_| panic!("could not run bindgen on header {header}")) .write(Box::new(&mut output)) diff --git a/libduckdb-sys/duckdb-sources b/libduckdb-sys/duckdb-sources index 401c8061..3c695d7b 160000 --- a/libduckdb-sys/duckdb-sources +++ b/libduckdb-sys/duckdb-sources @@ -1 +1 @@ -Subproject commit 401c8061c6ece35949cac58c7770cc755710ca86 +Subproject commit 3c695d7ba94d95d9facee48d395f46ed0bd72b46 diff --git a/libduckdb-sys/duckdb.tar.gz b/libduckdb-sys/duckdb.tar.gz index 0f525fdb..cf6acf72 100644 Binary files a/libduckdb-sys/duckdb.tar.gz and b/libduckdb-sys/duckdb.tar.gz differ diff --git a/libduckdb-sys/src/bindgen_bundled_version.rs b/libduckdb-sys/src/bindgen_bundled_version.rs index 6af1350f..099417cd 100644 --- a/libduckdb-sys/src/bindgen_bundled_version.rs +++ b/libduckdb-sys/src/bindgen_bundled_version.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.68.1 */ +/* automatically generated by rust-bindgen 0.69.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -164,10 +164,11 @@ pub const SIG_ATOMIC_MAX: u32 = 2147483647; pub const __API_TO_BE_DEPRECATED: u32 = 100000; pub const __API_TO_BE_DEPRECATED_MACOS: u32 = 100000; pub const __API_TO_BE_DEPRECATED_IOS: u32 = 100000; -pub const __API_TO_BE_DEPRECATED_TVOS: u32 = 100000; -pub const __API_TO_BE_DEPRECATED_WATCHOS: u32 = 100000; pub const __API_TO_BE_DEPRECATED_MACCATALYST: u32 = 100000; +pub const __API_TO_BE_DEPRECATED_WATCHOS: u32 = 100000; +pub const __API_TO_BE_DEPRECATED_TVOS: u32 = 100000; pub const __API_TO_BE_DEPRECATED_DRIVERKIT: u32 = 100000; +pub const __API_TO_BE_DEPRECATED_XROS: u32 = 100000; pub const __MAC_10_0: u32 = 1000; pub const __MAC_10_1: u32 = 1010; pub const __MAC_10_2: u32 = 1020; @@ -196,6 +197,7 @@ pub const __MAC_10_13_4: u32 = 101304; pub const __MAC_10_14: u32 = 101400; pub const __MAC_10_14_1: u32 = 101401; pub const __MAC_10_14_4: u32 = 101404; +pub const __MAC_10_14_5: u32 = 101405; pub const __MAC_10_14_6: u32 = 101406; pub const __MAC_10_15: u32 = 101500; pub const __MAC_10_15_1: u32 = 101501; @@ -211,10 +213,14 @@ pub const __MAC_12_0: u32 = 120000; pub const __MAC_12_1: u32 = 120100; pub const __MAC_12_2: u32 = 120200; pub const __MAC_12_3: u32 = 120300; +pub const __MAC_12_4: u32 = 120400; +pub const __MAC_12_5: u32 = 120500; pub const __MAC_13_0: u32 = 130000; pub const __MAC_13_1: u32 = 130100; pub const __MAC_13_2: u32 = 130200; pub const __MAC_13_3: u32 = 130300; +pub const __MAC_13_4: u32 = 130400; +pub const __MAC_14_0: u32 = 140000; pub const __IPHONE_2_0: u32 = 20000; pub const __IPHONE_2_1: u32 = 20100; pub const __IPHONE_2_2: u32 = 20200; @@ -267,6 +273,7 @@ pub const __IPHONE_14_1: u32 = 140100; pub const __IPHONE_14_2: u32 = 140200; pub const __IPHONE_14_3: u32 = 140300; pub const __IPHONE_14_5: u32 = 140500; +pub const __IPHONE_14_4: u32 = 140400; pub const __IPHONE_14_6: u32 = 140600; pub const __IPHONE_14_7: u32 = 140700; pub const __IPHONE_14_8: u32 = 140800; @@ -275,11 +282,55 @@ pub const __IPHONE_15_1: u32 = 150100; pub const __IPHONE_15_2: u32 = 150200; pub const __IPHONE_15_3: u32 = 150300; pub const __IPHONE_15_4: u32 = 150400; +pub const __IPHONE_15_5: u32 = 150500; +pub const __IPHONE_15_6: u32 = 150600; pub const __IPHONE_16_0: u32 = 160000; pub const __IPHONE_16_1: u32 = 160100; pub const __IPHONE_16_2: u32 = 160200; pub const __IPHONE_16_3: u32 = 160300; pub const __IPHONE_16_4: u32 = 160400; +pub const __IPHONE_16_5: u32 = 160500; +pub const __IPHONE_17_0: u32 = 170000; +pub const __WATCHOS_1_0: u32 = 10000; +pub const __WATCHOS_2_0: u32 = 20000; +pub const __WATCHOS_2_1: u32 = 20100; +pub const __WATCHOS_2_2: u32 = 20200; +pub const __WATCHOS_3_0: u32 = 30000; +pub const __WATCHOS_3_1: u32 = 30100; +pub const __WATCHOS_3_1_1: u32 = 30101; +pub const __WATCHOS_3_2: u32 = 30200; +pub const __WATCHOS_4_0: u32 = 40000; +pub const __WATCHOS_4_1: u32 = 40100; +pub const __WATCHOS_4_2: u32 = 40200; +pub const __WATCHOS_4_3: u32 = 40300; +pub const __WATCHOS_5_0: u32 = 50000; +pub const __WATCHOS_5_1: u32 = 50100; +pub const __WATCHOS_5_2: u32 = 50200; +pub const __WATCHOS_5_3: u32 = 50300; +pub const __WATCHOS_6_0: u32 = 60000; +pub const __WATCHOS_6_1: u32 = 60100; +pub const __WATCHOS_6_2: u32 = 60200; +pub const __WATCHOS_7_0: u32 = 70000; +pub const __WATCHOS_7_1: u32 = 70100; +pub const __WATCHOS_7_2: u32 = 70200; +pub const __WATCHOS_7_3: u32 = 70300; +pub const __WATCHOS_7_4: u32 = 70400; +pub const __WATCHOS_7_5: u32 = 70500; +pub const __WATCHOS_7_6: u32 = 70600; +pub const __WATCHOS_8_0: u32 = 80000; +pub const __WATCHOS_8_1: u32 = 80100; +pub const __WATCHOS_8_3: u32 = 80300; +pub const __WATCHOS_8_4: u32 = 80400; +pub const __WATCHOS_8_5: u32 = 80500; +pub const __WATCHOS_8_6: u32 = 80600; +pub const __WATCHOS_8_7: u32 = 80700; +pub const __WATCHOS_9_0: u32 = 90000; +pub const __WATCHOS_9_1: u32 = 90100; +pub const __WATCHOS_9_2: u32 = 90200; +pub const __WATCHOS_9_3: u32 = 90300; +pub const __WATCHOS_9_4: u32 = 90400; +pub const __WATCHOS_9_5: u32 = 90500; +pub const __WATCHOS_10_0: u32 = 100000; pub const __TVOS_9_0: u32 = 90000; pub const __TVOS_9_1: u32 = 90100; pub const __TVOS_9_2: u32 = 90200; @@ -313,47 +364,43 @@ pub const __TVOS_15_1: u32 = 150100; pub const __TVOS_15_2: u32 = 150200; pub const __TVOS_15_3: u32 = 150300; pub const __TVOS_15_4: u32 = 150400; +pub const __TVOS_15_5: u32 = 150500; +pub const __TVOS_15_6: u32 = 150600; pub const __TVOS_16_0: u32 = 160000; pub const __TVOS_16_1: u32 = 160100; pub const __TVOS_16_2: u32 = 160200; pub const __TVOS_16_3: u32 = 160300; pub const __TVOS_16_4: u32 = 160400; -pub const __WATCHOS_1_0: u32 = 10000; -pub const __WATCHOS_2_0: u32 = 20000; -pub const __WATCHOS_2_1: u32 = 20100; -pub const __WATCHOS_2_2: u32 = 20200; -pub const __WATCHOS_3_0: u32 = 30000; -pub const __WATCHOS_3_1: u32 = 30100; -pub const __WATCHOS_3_1_1: u32 = 30101; -pub const __WATCHOS_3_2: u32 = 30200; -pub const __WATCHOS_4_0: u32 = 40000; -pub const __WATCHOS_4_1: u32 = 40100; -pub const __WATCHOS_4_2: u32 = 40200; -pub const __WATCHOS_4_3: u32 = 40300; -pub const __WATCHOS_5_0: u32 = 50000; -pub const __WATCHOS_5_1: u32 = 50100; -pub const __WATCHOS_5_2: u32 = 50200; -pub const __WATCHOS_5_3: u32 = 50300; -pub const __WATCHOS_6_0: u32 = 60000; -pub const __WATCHOS_6_1: u32 = 60100; -pub const __WATCHOS_6_2: u32 = 60200; -pub const __WATCHOS_7_0: u32 = 70000; -pub const __WATCHOS_7_1: u32 = 70100; -pub const __WATCHOS_7_2: u32 = 70200; -pub const __WATCHOS_7_3: u32 = 70300; -pub const __WATCHOS_7_4: u32 = 70400; -pub const __WATCHOS_7_5: u32 = 70500; -pub const __WATCHOS_7_6: u32 = 70600; -pub const __WATCHOS_8_0: u32 = 80000; -pub const __WATCHOS_8_1: u32 = 80100; -pub const __WATCHOS_8_3: u32 = 80300; -pub const __WATCHOS_8_4: u32 = 80400; -pub const __WATCHOS_8_5: u32 = 80500; -pub const __WATCHOS_9_0: u32 = 90000; -pub const __WATCHOS_9_1: u32 = 90100; -pub const __WATCHOS_9_2: u32 = 90200; -pub const __WATCHOS_9_3: u32 = 90300; -pub const __WATCHOS_9_4: u32 = 90400; +pub const __TVOS_16_5: u32 = 160500; +pub const __TVOS_17_0: u32 = 170000; +pub const __BRIDGEOS_2_0: u32 = 20000; +pub const __BRIDGEOS_3_0: u32 = 30000; +pub const __BRIDGEOS_3_1: u32 = 30100; +pub const __BRIDGEOS_3_4: u32 = 30400; +pub const __BRIDGEOS_4_0: u32 = 40000; +pub const __BRIDGEOS_4_1: u32 = 40100; +pub const __BRIDGEOS_5_0: u32 = 50000; +pub const __BRIDGEOS_5_1: u32 = 50100; +pub const __BRIDGEOS_5_3: u32 = 50300; +pub const __BRIDGEOS_6_0: u32 = 60000; +pub const __BRIDGEOS_6_2: u32 = 60200; +pub const __BRIDGEOS_6_4: u32 = 60400; +pub const __BRIDGEOS_6_5: u32 = 60500; +pub const __BRIDGEOS_6_6: u32 = 60600; +pub const __BRIDGEOS_7_0: u32 = 70000; +pub const __BRIDGEOS_7_1: u32 = 70100; +pub const __BRIDGEOS_7_2: u32 = 70200; +pub const __BRIDGEOS_7_3: u32 = 70300; +pub const __BRIDGEOS_7_4: u32 = 70400; +pub const __BRIDGEOS_8_0: u32 = 80000; +pub const __DRIVERKIT_19_0: u32 = 190000; +pub const __DRIVERKIT_20_0: u32 = 200000; +pub const __DRIVERKIT_21_0: u32 = 210000; +pub const __DRIVERKIT_22_0: u32 = 220000; +pub const __DRIVERKIT_22_4: u32 = 220400; +pub const __DRIVERKIT_22_5: u32 = 220500; +pub const __DRIVERKIT_23_0: u32 = 230000; +pub const __XROS_1_0: u32 = 10000; pub const MAC_OS_X_VERSION_10_0: u32 = 1000; pub const MAC_OS_X_VERSION_10_1: u32 = 1010; pub const MAC_OS_X_VERSION_10_2: u32 = 1020; @@ -382,17 +429,31 @@ pub const MAC_OS_X_VERSION_10_13_4: u32 = 101304; pub const MAC_OS_X_VERSION_10_14: u32 = 101400; pub const MAC_OS_X_VERSION_10_14_1: u32 = 101401; pub const MAC_OS_X_VERSION_10_14_4: u32 = 101404; +pub const MAC_OS_X_VERSION_10_14_5: u32 = 101405; pub const MAC_OS_X_VERSION_10_14_6: u32 = 101406; pub const MAC_OS_X_VERSION_10_15: u32 = 101500; pub const MAC_OS_X_VERSION_10_15_1: u32 = 101501; +pub const MAC_OS_X_VERSION_10_15_4: u32 = 101504; pub const MAC_OS_X_VERSION_10_16: u32 = 101600; pub const MAC_OS_VERSION_11_0: u32 = 110000; +pub const MAC_OS_VERSION_11_1: u32 = 110100; +pub const MAC_OS_VERSION_11_3: u32 = 110300; +pub const MAC_OS_VERSION_11_4: u32 = 110400; +pub const MAC_OS_VERSION_11_5: u32 = 110500; +pub const MAC_OS_VERSION_11_6: u32 = 110600; pub const MAC_OS_VERSION_12_0: u32 = 120000; +pub const MAC_OS_VERSION_12_1: u32 = 120100; +pub const MAC_OS_VERSION_12_2: u32 = 120200; +pub const MAC_OS_VERSION_12_3: u32 = 120300; +pub const MAC_OS_VERSION_12_4: u32 = 120400; +pub const MAC_OS_VERSION_12_5: u32 = 120500; pub const MAC_OS_VERSION_13_0: u32 = 130000; -pub const __DRIVERKIT_19_0: u32 = 190000; -pub const __DRIVERKIT_20_0: u32 = 200000; -pub const __DRIVERKIT_21_0: u32 = 210000; -pub const __MAC_OS_X_VERSION_MAX_ALLOWED: u32 = 130300; +pub const MAC_OS_VERSION_13_1: u32 = 130100; +pub const MAC_OS_VERSION_13_2: u32 = 130200; +pub const MAC_OS_VERSION_13_3: u32 = 130300; +pub const MAC_OS_VERSION_13_4: u32 = 130400; +pub const MAC_OS_VERSION_14_0: u32 = 140000; +pub const __MAC_OS_X_VERSION_MAX_ALLOWED: u32 = 140000; pub const __ENABLE_LEGACY_MAC_AVAILABILITY: u32 = 1; pub const __DARWIN_WCHAR_MIN: i32 = -2147483648; pub const _FORTIFY_SOURCE: u32 = 2; @@ -586,6 +647,8 @@ pub const IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_OFF: u32 = 0; pub const IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_ON: u32 = 1; pub const IOPOL_VFS_DISALLOW_RW_FOR_O_EVTONLY_DEFAULT: u32 = 0; pub const IOPOL_VFS_DISALLOW_RW_FOR_O_EVTONLY_ON: u32 = 1; +pub const IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_DEFAULT: u32 = 0; +pub const IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_ON: u32 = 1; pub const WNOHANG: u32 = 1; pub const WUNTRACED: u32 = 2; pub const WCOREFLAG: u32 = 128; @@ -5424,6 +5487,88 @@ fn bindgen_test_layout_lldiv_t() { extern "C" { pub static mut __mb_cur_max: ::std::os::raw::c_int; } +pub type malloc_type_id_t = ::std::os::raw::c_ulonglong; +extern "C" { + pub fn malloc_type_malloc(size: usize, type_id: malloc_type_id_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_calloc(count: usize, size: usize, type_id: malloc_type_id_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_free(ptr: *mut ::std::os::raw::c_void, type_id: malloc_type_id_t); +} +extern "C" { + pub fn malloc_type_realloc( + ptr: *mut ::std::os::raw::c_void, + size: usize, + type_id: malloc_type_id_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_valloc(size: usize, type_id: malloc_type_id_t) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_aligned_alloc( + alignment: usize, + size: usize, + type_id: malloc_type_id_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_posix_memalign( + memptr: *mut *mut ::std::os::raw::c_void, + alignment: usize, + size: usize, + type_id: malloc_type_id_t, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _malloc_zone_t { + _unused: [u8; 0], +} +pub type malloc_zone_t = _malloc_zone_t; +extern "C" { + pub fn malloc_type_zone_malloc( + zone: *mut malloc_zone_t, + size: usize, + type_id: malloc_type_id_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_zone_calloc( + zone: *mut malloc_zone_t, + count: usize, + size: usize, + type_id: malloc_type_id_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_zone_free(zone: *mut malloc_zone_t, ptr: *mut ::std::os::raw::c_void, type_id: malloc_type_id_t); +} +extern "C" { + pub fn malloc_type_zone_realloc( + zone: *mut malloc_zone_t, + ptr: *mut ::std::os::raw::c_void, + size: usize, + type_id: malloc_type_id_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_zone_valloc( + zone: *mut malloc_zone_t, + size: usize, + type_id: malloc_type_id_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn malloc_type_zone_memalign( + zone: *mut malloc_zone_t, + alignment: usize, + size: usize, + type_id: malloc_type_id_t, + ) -> *mut ::std::os::raw::c_void; +} extern "C" { pub fn malloc(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; } diff --git a/libduckdb-sys/upgrade.sh b/libduckdb-sys/upgrade.sh index 6282d4de..ff23397b 100755 --- a/libduckdb-sys/upgrade.sh +++ b/libduckdb-sys/upgrade.sh @@ -10,7 +10,7 @@ export DUCKDB_LIB_DIR="$SCRIPT_DIR/duckdb" export DU_INCLUDE_DIR="$DUCKDB_LIB_DIR" # Download and extract amalgamation -DUCKDB_VERSION=v0.9.1 +DUCKDB_VERSION=v0.9.2 git submodule update --init --checkout cd "$SCRIPT_DIR/duckdb-sources" || { echo "fatal error" >&2; exit 1; } git fetch diff --git a/src/raw_statement.rs b/src/raw_statement.rs index 633224b5..647d907c 100644 --- a/src/raw_statement.rs +++ b/src/raw_statement.rs @@ -143,13 +143,7 @@ impl RawStatement { let import_arrow2_array = arrow2::ffi::import_array_from_c(ffi_arrow2_array, arrow2_field.data_type); if let Err(err) = import_arrow2_array { - // When array is empty, import_array_from_c returns error with message - // "OutOfSpec("An ArrowArray of type X must have non-null children") - // Therefore, we return None when encountering this error. - match err { - arrow2::error::Error::OutOfSpec(_) => return None, - _ => panic!("Failed to import arrow2 Array from C: {}", err), - } + panic!("Failed to import arrow2 Array from C: {}", err) } let arrow2_array = import_arrow2_array.unwrap(); diff --git a/upgrade.sh b/upgrade.sh index 08254623..d4046929 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -20,7 +20,7 @@ if [ $duckdb_version = $duckdb_rs_version ]; then exit 0 fi -echo "Start to upgrade from $duckdb_version to $duckdb_rs_version" +echo "Start to upgrade from $duckdb_rs_version to $duckdb_version" sed -i '' "s/$duckdb_rs_version/$duckdb_version/g" Cargo.toml libduckdb-sys/upgrade.sh libduckdb-sys/Cargo.toml .github/workflows/rust.yaml ./libduckdb-sys/upgrade.sh