From 809cb0e3fb0436338eab4136884e711b0177fc6f Mon Sep 17 00:00:00 2001 From: DuckLabs GitHub Bot Date: Wed, 2 Dec 2026 11:41:56 +0000 Subject: [PATCH] Update vendored DuckDB sources to ea0a0e92586 --- src/duckdb/generated_extension_loader_package_build.cpp | 8 ++++---- .../src/execution/operator/persistent/physical_update.cpp | 3 +++ src/duckdb/src/function/table/version/pragma_version.cpp | 6 +++--- src/duckdb/src/include/duckdb/storage/data_table.hpp | 6 +++--- src/duckdb/src/storage/data_table.cpp | 6 +++--- src/duckdb/src/storage/table/update_segment.cpp | 4 +++- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/duckdb/generated_extension_loader_package_build.cpp b/src/duckdb/generated_extension_loader_package_build.cpp index c7c1e9187..c5d38769f 100644 --- a/src/duckdb/generated_extension_loader_package_build.cpp +++ b/src/duckdb/generated_extension_loader_package_build.cpp @@ -45,7 +45,7 @@ int32_t duckdb_extension_core_functions_describe(duckdb_extension_descriptor *de descriptor->version = 1; descriptor->name = "core_functions"; descriptor->extension_version = EXT_VERSION_CORE_FUNCTIONS; - descriptor->api_version = "v2.0.2-alpha58209"; + descriptor->api_version = "v2.0.2-alpha58727"; descriptor->entry_cpp = (void (*)(void))core_functions_duckdb_cpp_init; return 0; } @@ -78,7 +78,7 @@ int32_t duckdb_extension_parquet_describe(duckdb_extension_descriptor *descripto descriptor->version = 1; descriptor->name = "parquet"; descriptor->extension_version = EXT_VERSION_PARQUET; - descriptor->api_version = "v2.0.2-alpha58209"; + descriptor->api_version = "v2.0.2-alpha58727"; descriptor->entry_cpp = (void (*)(void))parquet_duckdb_cpp_init; return 0; } @@ -111,7 +111,7 @@ int32_t duckdb_extension_icu_describe(duckdb_extension_descriptor *descriptor) { descriptor->version = 1; descriptor->name = "icu"; descriptor->extension_version = EXT_VERSION_ICU; - descriptor->api_version = "v2.0.2-alpha58209"; + descriptor->api_version = "v2.0.2-alpha58727"; descriptor->entry_cpp = (void (*)(void))icu_duckdb_cpp_init; return 0; } @@ -144,7 +144,7 @@ int32_t duckdb_extension_json_describe(duckdb_extension_descriptor *descriptor) descriptor->version = 1; descriptor->name = "json"; descriptor->extension_version = EXT_VERSION_JSON; - descriptor->api_version = "v2.0.2-alpha58209"; + descriptor->api_version = "v2.0.2-alpha58727"; descriptor->entry_cpp = (void (*)(void))json_duckdb_cpp_init; return 0; } diff --git a/src/duckdb/src/execution/operator/persistent/physical_update.cpp b/src/duckdb/src/execution/operator/persistent/physical_update.cpp index 230963cb3..99265c8ba 100644 --- a/src/duckdb/src/execution/operator/persistent/physical_update.cpp +++ b/src/duckdb/src/execution/operator/persistent/physical_update.cpp @@ -206,6 +206,9 @@ SinkResultType PhysicalUpdate::Sink(ExecutionContext &context, DataChunk &chunk, // The update chunk now contains exactly those rows that we are deleting. Vector del_row_ids(Vector::Ref(row_ids)); if (update_count != update_chunk.size()) { + // like an in-place update, check every match, also those that are not written + ConstraintState constraint_state(tableref, bound_constraints); + table.VerifyUpdateConstraints(constraint_state, context.client, update_chunk, columns); update_chunk.Slice(sel, update_count); del_row_ids.Slice(row_ids, sel, update_count); } diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index 04846c087..5336e438d 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-alpha58209" +#define DUCKDB_PATCH_VERSION "2-alpha58727" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 0 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 2 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v2.0.2-alpha58209" +#define DUCKDB_VERSION "v2.0.2-alpha58727" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "16cfccddc4" +#define DUCKDB_SOURCE_ID "ea0a0e9258" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/include/duckdb/storage/data_table.hpp b/src/duckdb/src/include/duckdb/storage/data_table.hpp index 72ee1d0bf..a1b341977 100644 --- a/src/duckdb/src/include/duckdb/storage/data_table.hpp +++ b/src/duckdb/src/include/duckdb/storage/data_table.hpp @@ -259,6 +259,9 @@ class DataTable : public enable_shared_from_this { //! Verify constraints with a chunk from the Append containing all columns of the table void VerifyAppendConstraints(ConstraintState &constraint_state, ClientContext &context, DataChunk &chunk, optional_ptr local_storage, optional_ptr manager); + //! Verify the NOT NULL and CHECK constraints of a chunk from the Update containing only the specified column_ids + void VerifyUpdateConstraints(ConstraintState &state, ClientContext &context, DataChunk &chunk, + const vector &column_ids); shared_ptr &GetDataTableInfo(); @@ -299,9 +302,6 @@ class DataTable : public enable_shared_from_this { //! Verify the new added constraints against current persistent&local data void VerifyNewConstraint(LocalStorage &local_storage, DataTable &parent, const BoundConstraint &constraint); - //! Verify constraints with a chunk from the Update containing only the specified column_ids - void VerifyUpdateConstraints(ConstraintState &state, ClientContext &context, DataChunk &chunk, - const vector &column_ids); //! Verify constraints with a chunk from the Delete containing all columns of the table void VerifyDeleteConstraints(optional_ptr storage, TableDeleteState &state, ClientContext &context, DataChunk &chunk); diff --git a/src/duckdb/src/storage/data_table.cpp b/src/duckdb/src/storage/data_table.cpp index b0bada30a..cbe389603 100644 --- a/src/duckdb/src/storage/data_table.cpp +++ b/src/duckdb/src/storage/data_table.cpp @@ -1479,9 +1479,6 @@ void DataTable::VerifyUpdateConstraints(ConstraintState &state, ClientContext &c throw NotImplementedException("Constraint type not implemented!"); } } - // Ensure that we never call UPDATE for indexed columns. - // Instead, we must rewrite these updates into DELETE + INSERT. - info->indexes.VerifyUpdate(column_ids); } unique_ptr DataTable::InitializeUpdate(TableCatalogEntry &table, ClientContext &context, @@ -1512,6 +1509,9 @@ void DataTable::Update(TableUpdateState &state, ClientContext &context, DuckTabl // first verify that no constraints are violated VerifyUpdateConstraints(*state.constraint_state, context, updates, column_ids); + // Ensure that we never call UPDATE for indexed columns. + // Instead, we must rewrite these updates into DELETE + INSERT. + info->indexes.VerifyUpdate(column_ids); // now perform the actual update Vector max_row_id_vec(Value::BIGINT(MAX_ROW_ID), count_t(count)); diff --git a/src/duckdb/src/storage/table/update_segment.cpp b/src/duckdb/src/storage/table/update_segment.cpp index 0a255ef97..1e59ad3a2 100644 --- a/src/duckdb/src/storage/table/update_segment.cpp +++ b/src/duckdb/src/storage/table/update_segment.cpp @@ -1312,7 +1312,9 @@ static idx_t SortSelectionVector(SelectionVector &sel, idx_t count, row_t *ids) for (idx_t i = 0; i < count; i++) { sorted_sel.set_index(i, sel.get_index(i)); } - std::sort(sorted_sel.data(), sorted_sel.data() + count, [&](sel_t l, sel_t r) { return ids[l] < ids[r]; }); + // every column keeps the last entry of a repeated row id, so a row never mixes values of different entries + std::sort(sorted_sel.data(), sorted_sel.data() + count, + [&](sel_t l, sel_t r) { return ids[l] == ids[r] ? l > r : ids[l] < ids[r]; }); // eliminate any duplicates idx_t pos = 1; for (idx_t i = 1; i < count; i++) {