From a34bebf7d3bb5d6f3bbb190426781f9b20556f5b Mon Sep 17 00:00:00 2001 From: DuckDB Labs GitHub Bot Date: Tue, 7 Apr 2026 05:37:03 +0000 Subject: [PATCH] Update vendored DuckDB sources to c241da23ae --- .../core_functions/scalar/string/repeat.cpp | 13 +++++++++++-- src/duckdb/src/common/types/geometry.cpp | 14 ++++++++++++-- src/duckdb/src/function/table/arrow_conversion.cpp | 2 +- .../src/function/table/version/pragma_version.cpp | 6 +++--- src/duckdb/src/main/database_manager.cpp | 4 ++-- .../src/parser/parsed_data/create_view_info.cpp | 1 + 6 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/duckdb/extension/core_functions/scalar/string/repeat.cpp b/src/duckdb/extension/core_functions/scalar/string/repeat.cpp index c93bbfa5e..6a8d67b1b 100644 --- a/src/duckdb/extension/core_functions/scalar/string/repeat.cpp +++ b/src/duckdb/extension/core_functions/scalar/string/repeat.cpp @@ -1,5 +1,6 @@ #include "duckdb/common/vector_operations/binary_executor.hpp" #include "core_functions/scalar/string_functions.hpp" +#include "duckdb/common/operator/add.hpp" #include "duckdb/common/operator/multiply.hpp" namespace duckdb { @@ -42,8 +43,16 @@ static void RepeatListFunction(DataChunk &args, ExpressionState &, Vector &resul BinaryExecutor::Execute( list_vector, cnt_vector, result, args.size(), [&](list_entry_t list_input, int64_t cnt) { idx_t copy_count = cnt <= 0 || list_input.length == 0 ? 0 : UnsafeNumericCast(cnt); - idx_t result_length = list_input.length * copy_count; - idx_t new_size = current_size + result_length; + idx_t result_length; + if (!TryMultiplyOperator::Operation(list_input.length, copy_count, result_length)) { + throw OutOfRangeException("Cannot create a list of size: '%d' * '%d', the result is too large", + list_input.length, copy_count); + } + idx_t new_size; + if (!TryAddOperator::Operation(current_size, result_length, new_size)) { + throw OutOfRangeException("Cannot create a list of size: '%d' + '%d', the result is too large", + current_size, result_length); + } ListVector::Reserve(result, new_size); list_entry_t result_list; result_list.offset = current_size; diff --git a/src/duckdb/src/common/types/geometry.cpp b/src/duckdb/src/common/types/geometry.cpp index 35d8e1467..10ea22ff5 100644 --- a/src/duckdb/src/common/types/geometry.cpp +++ b/src/duckdb/src/common/types/geometry.cpp @@ -205,9 +205,19 @@ class TextWriter { buffer.push_back(c); } void Write(double value) { + auto start = buffer.size(); duckdb_fmt::format_to(std::back_inserter(buffer), "{}", value); - // Remove trailing zero - if (buffer.back() == '0') { + // Remove trailing ".0" (e.g. "10.0" -> "10"), but only when the number + // is in fixed notation. Scientific notation like "1e+20" must not be + // touched — stripping the trailing '0' would corrupt the exponent. + bool has_exponent = false; + for (auto i = start; i < buffer.size(); i++) { + if (buffer[i] == 'e' || buffer[i] == 'E') { + has_exponent = true; + break; + } + } + if (!has_exponent && buffer.back() == '0') { buffer.pop_back(); if (buffer.back() == '.') { buffer.pop_back(); diff --git a/src/duckdb/src/function/table/arrow_conversion.cpp b/src/duckdb/src/function/table/arrow_conversion.cpp index 7c1bacdd9..4a24000f4 100644 --- a/src/duckdb/src/function/table/arrow_conversion.cpp +++ b/src/duckdb/src/function/table/arrow_conversion.cpp @@ -736,7 +736,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)); diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index acf3eb70e..bf7fe6b04 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 "2-dev408" +#define DUCKDB_PATCH_VERSION "2-dev419" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 5 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 1 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v1.5.2-dev408" +#define DUCKDB_VERSION "v1.5.2-dev419" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "cbc6f2230e" +#define DUCKDB_SOURCE_ID "c241da23ae" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/main/database_manager.cpp b/src/duckdb/src/main/database_manager.cpp index 93b323d33..d218de6c1 100644 --- a/src/duckdb/src/main/database_manager.cpp +++ b/src/duckdb/src/main/database_manager.cpp @@ -242,7 +242,7 @@ optional_ptr DatabaseManager::FinalizeAttach(ClientContext &co } void DatabaseManager::DetachDatabase(ClientContext &context, const string &name, OnEntryNotFound if_not_found) { - if (GetDefaultDatabase(context) == name) { + if (StringUtil::CIEquals(GetDefaultDatabase(context), name)) { throw BinderException("Cannot detach database \"%s\" because it is the default database. Select a different " "database using `USE` to allow detaching this database", name); @@ -305,7 +305,7 @@ void DatabaseManager::RenameDatabase(ClientContext &context, const string &old_n databases[new_name] = attached_db; } - if (default_database == old_name) { + if (StringUtil::CIEquals(default_database, old_name)) { default_database = new_name; } } diff --git a/src/duckdb/src/parser/parsed_data/create_view_info.cpp b/src/duckdb/src/parser/parsed_data/create_view_info.cpp index c574cf572..ff46a3a49 100644 --- a/src/duckdb/src/parser/parsed_data/create_view_info.cpp +++ b/src/duckdb/src/parser/parsed_data/create_view_info.cpp @@ -39,6 +39,7 @@ unique_ptr CreateViewInfo::Copy() const { CopyProperties(*result); result->aliases = aliases; result->types = types; + result->names = names; result->column_comments_map = column_comments_map; result->query = unique_ptr_cast(query->Copy()); return std::move(result);