From c0ac5c472be23ecf88eef2ae8d98bb0c52bcabb0 Mon Sep 17 00:00:00 2001 From: DuckDB Labs GitHub Bot Date: Mon, 8 Jun 2026 06:21:33 +0000 Subject: [PATCH] Update vendored DuckDB sources to 3b4213a993 --- src/duckdb/src/common/arrow/appender/union_data.cpp | 7 ++++--- src/duckdb/src/function/cast/array_casts.cpp | 1 + src/duckdb/src/function/table/arrow_conversion.cpp | 7 +++++-- .../src/function/table/version/pragma_version.cpp | 6 +++--- .../duckdb/storage/compression/alprd/alprd_scan.hpp | 6 +++++- src/duckdb/src/main/connection_manager.cpp | 11 +++++------ src/duckdb/src/main/secret/default_secrets.cpp | 5 ++++- 7 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/duckdb/src/common/arrow/appender/union_data.cpp b/src/duckdb/src/common/arrow/appender/union_data.cpp index 4ca4ebf67..29faa5222 100644 --- a/src/duckdb/src/common/arrow/appender/union_data.cpp +++ b/src/duckdb/src/common/arrow/appender/union_data.cpp @@ -28,7 +28,8 @@ void ArrowUnionData::Append(ArrowAppendData &append_data, Vector &input, idx_t f child_vectors.emplace_back(child.second, size); } - for (idx_t input_idx = from; input_idx < to; input_idx++) { + for (idx_t i = 0; i < size; i++) { + auto input_idx = from + i; const auto &val = input.GetValue(input_idx); idx_t tag = 0; @@ -40,7 +41,7 @@ void ArrowUnionData::Append(ArrowAppendData &append_data, Vector &input, idx_t f } for (idx_t child_idx = 0; child_idx < child_vectors.size(); child_idx++) { - child_vectors[child_idx].SetValue(input_idx, child_idx == tag ? resolved_value : Value(nullptr)); + child_vectors[child_idx].SetValue(i, child_idx == tag ? resolved_value : Value(nullptr)); } types_buffer.push_back(NumericCast(tag)); } @@ -48,7 +49,7 @@ void ArrowUnionData::Append(ArrowAppendData &append_data, Vector &input, idx_t f for (idx_t child_idx = 0; child_idx < child_vectors.size(); child_idx++) { auto &child_buffer = append_data.child_data[child_idx]; auto &child = child_vectors[child_idx]; - child_buffer->append_vector(*child_buffer, child, from, to, size); + child_buffer->append_vector(*child_buffer, child, 0, size, size); } append_data.row_count += size; } diff --git a/src/duckdb/src/function/cast/array_casts.cpp b/src/duckdb/src/function/cast/array_casts.cpp index 2357a2c2c..1f8ac063a 100644 --- a/src/duckdb/src/function/cast/array_casts.cpp +++ b/src/duckdb/src/function/cast/array_casts.cpp @@ -61,6 +61,7 @@ static bool ArrayToArrayCast(Vector &source, Vector &result, idx_t count, CastPa if (ConstantVector::IsNull(source)) { ConstantVector::SetNull(result, true); + return true; } auto &source_cc = ArrayVector::GetEntry(source); diff --git a/src/duckdb/src/function/table/arrow_conversion.cpp b/src/duckdb/src/function/table/arrow_conversion.cpp index e194852f0..367d6f6c3 100644 --- a/src/duckdb/src/function/table/arrow_conversion.cpp +++ b/src/duckdb/src/function/table/arrow_conversion.cpp @@ -685,7 +685,7 @@ void ArrowToDuckDBConversion::ColumnArrowToDuckDBRunEndEncoded(Vector &vector, c FlattenRunEndsSwitch(vector, run_end_encoding, compressed_size, scan_offset, size); break; case PhysicalType::INT64: - FlattenRunEndsSwitch(vector, run_end_encoding, compressed_size, scan_offset, size); + FlattenRunEndsSwitch(vector, run_end_encoding, compressed_size, scan_offset, size); break; default: throw NotImplementedException("Type '%s' not implemented for RunEndEncoding", TypeIdToString(physical_type)); @@ -1118,7 +1118,10 @@ void ArrowToDuckDBConversion::ColumnArrowToDuckDB(Vector &vector, ArrowArray &ar break; } case LogicalTypeId::UNION: { - auto type_ids = ArrowBufferData(array, array.n_buffers == 1 ? 0 : 1); + auto type_ids_buffer_idx = array.n_buffers == 1 ? 0 : 1; + auto effective_offset = + GetEffectiveOffset(array, NumericCast(parent_offset), chunk_offset, nested_offset); + auto type_ids = ArrowBufferData(array, type_ids_buffer_idx) + effective_offset; D_ASSERT(type_ids); auto members = UnionType::CopyMemberTypes(vector.GetType()); diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index df2d6cfe5..4cf88fffb 100644 --- a/src/duckdb/src/function/table/version/pragma_version.cpp +++ b/src/duckdb/src/function/table/version/pragma_version.cpp @@ -1,5 +1,5 @@ #ifndef DUCKDB_PATCH_VERSION -#define DUCKDB_PATCH_VERSION "5-dev85" +#define DUCKDB_PATCH_VERSION "5-dev98" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 4 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 1 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v1.4.5-dev85" +#define DUCKDB_VERSION "v1.4.5-dev98" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "123e696a93" +#define DUCKDB_SOURCE_ID "3b4213a993" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp b/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp index a3feb94b5..4b3f6b991 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp @@ -90,7 +90,11 @@ struct AlpRDScanState : public SegmentScanState { uint8_t actual_dictionary_size = Load(segment_data + AlpRDConstants::METADATA_POINTER_SIZE + AlpRDConstants::RIGHT_BIT_WIDTH_SIZE + AlpRDConstants::LEFT_BIT_WIDTH_SIZE); - uint8_t actual_dictionary_size_bytes = actual_dictionary_size * AlpRDConstants::DICTIONARY_ELEMENT_SIZE; + if (actual_dictionary_size > AlpRDConstants::MAX_DICTIONARY_SIZE) { + throw IOException("Corrupt database file: ALPRD dictionary size exceeds maximum"); + } + idx_t actual_dictionary_size_bytes = + static_cast(actual_dictionary_size) * AlpRDConstants::DICTIONARY_ELEMENT_SIZE; // Load the left parts dictionary which is after the segment header and is of a fixed size memcpy(vector_state.left_parts_dict, (void *)(segment_data + AlpRDConstants::HEADER_SIZE), diff --git a/src/duckdb/src/main/connection_manager.cpp b/src/duckdb/src/main/connection_manager.cpp index 436c89eff..a94038851 100644 --- a/src/duckdb/src/main/connection_manager.cpp +++ b/src/duckdb/src/main/connection_manager.cpp @@ -38,17 +38,16 @@ void ConnectionManager::AssignConnectionId(Connection &connection) { vector> ConnectionManager::GetConnectionList() { lock_guard lock(connections_lock); vector> result; - for (auto &it : connections) { - auto connection = it.second.lock(); + for (auto it = connections.begin(); it != connections.end();) { + auto connection = it->second.lock(); if (!connection) { - connections.erase(it.first); - connection_count = connections.size(); - continue; + it = connections.erase(it); } else { result.push_back(std::move(connection)); + ++it; } } - + connection_count = connections.size(); return result; } diff --git a/src/duckdb/src/main/secret/default_secrets.cpp b/src/duckdb/src/main/secret/default_secrets.cpp index 2dd9fbc85..81fba179f 100644 --- a/src/duckdb/src/main/secret/default_secrets.cpp +++ b/src/duckdb/src/main/secret/default_secrets.cpp @@ -85,6 +85,9 @@ unique_ptr CreateHTTPSecretFunctions::CreateHTTPSecretFromEnv(Client secret->TrySetValue("extra_http_headers", input); secret->TrySetValue("bearer_token", input); + //! Set redact keys + secret->redact_keys = {"http_proxy_password", "bearer_token"}; + return std::move(secret); } @@ -100,7 +103,7 @@ unique_ptr CreateHTTPSecretFunctions::CreateHTTPSecretFromConfig(Cli secret->TrySetValue("bearer_token", input); //! Set redact keys - secret->redact_keys = {"http_proxy_password"}; + secret->redact_keys = {"http_proxy_password", "bearer_token"}; return std::move(secret); }