Skip to content

Commit 7fbf610

Browse files
duckdblabs-botgithub-actions[bot]
authored andcommitted
Update vendored DuckDB sources to 8090b8d52e
1 parent 58c6ba1 commit 7fbf610

File tree

5 files changed

+35
-10
lines changed

5 files changed

+35
-10
lines changed

src/duckdb/src/execution/expression_executor/execute_comparison.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,19 @@ static idx_t TemplatedSelectOperation(Vector &left, Vector &right, optional_ptr<
138138
false_sel.get());
139139
case PhysicalType::LIST:
140140
case PhysicalType::STRUCT:
141-
case PhysicalType::ARRAY:
142-
return NestedSelectOperation<OP>(left, right, sel, count, true_sel, false_sel, null_mask);
141+
case PhysicalType::ARRAY: {
142+
auto result_count = NestedSelectOperation<OP>(left, right, sel, count, true_sel, false_sel, null_mask);
143+
if (true_sel && result_count > 0) {
144+
std::sort(true_sel->data(), true_sel->data() + result_count);
145+
}
146+
if (false_sel) {
147+
idx_t false_count = count - result_count;
148+
if (false_count > 0) {
149+
std::sort(false_sel->data(), false_sel->data() + false_count);
150+
}
151+
}
152+
return result_count;
153+
}
143154
default:
144155
throw InternalException("Invalid type for comparison");
145156
}

src/duckdb/src/function/table/version/pragma_version.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef DUCKDB_PATCH_VERSION
2-
#define DUCKDB_PATCH_VERSION "2-dev291"
2+
#define DUCKDB_PATCH_VERSION "2-dev305"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 4
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.4.2-dev291"
11+
#define DUCKDB_VERSION "v1.4.2-dev305"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "396c86228b"
14+
#define DUCKDB_SOURCE_ID "8090b8d52e"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/main/extension_entries.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
227227
{"iceberg_metadata", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
228228
{"iceberg_scan", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
229229
{"iceberg_snapshots", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
230+
{"iceberg_table_properties", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
230231
{"iceberg_to_ducklake", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
231232
{"icu_calendar_names", "icu", CatalogType::TABLE_FUNCTION_ENTRY},
232233
{"icu_collate_af", "icu", CatalogType::SCALAR_FUNCTION_ENTRY},
@@ -525,6 +526,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
525526
{"regr_sxx", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
526527
{"regr_sxy", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
527528
{"regr_syy", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
529+
{"remove_iceberg_table_properties", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
528530
{"repeat", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
529531
{"replace", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
530532
{"replace_type", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
@@ -540,6 +542,7 @@ static constexpr ExtensionFunctionEntry EXTENSION_FUNCTIONS[] = {
540542
{"rtrim", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
541543
{"sem", "core_functions", CatalogType::AGGREGATE_FUNCTION_ENTRY},
542544
{"set_bit", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
545+
{"set_iceberg_table_properties", "iceberg", CatalogType::TABLE_FUNCTION_ENTRY},
543546
{"setseed", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},
544547
{"shapefile_meta", "spatial", CatalogType::TABLE_FUNCTION_ENTRY},
545548
{"sign", "core_functions", CatalogType::SCALAR_FUNCTION_ENTRY},

src/duckdb/src/planner/binder/statement/bind_merge_into.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,20 @@ unique_ptr<BoundMergeIntoAction> Binder::BindMergeAction(LogicalMergeInto &merge
4141
auto result = make_uniq<BoundMergeIntoAction>();
4242
result->action_type = action.action_type;
4343
if (action.condition) {
44-
ProjectionBinder proj_binder(*this, context, proj_index, expressions, "WHERE clause");
45-
proj_binder.target_type = LogicalType::BOOLEAN;
46-
auto cond = proj_binder.Bind(action.condition);
47-
result->condition = std::move(cond);
44+
if (action.condition->HasSubquery()) {
45+
// if we have a subquery we need to execute the condition outside of the MERGE INTO statement
46+
WhereBinder where_binder(*this, context);
47+
auto cond = where_binder.Bind(action.condition);
48+
PlanSubqueries(cond, root);
49+
result->condition =
50+
make_uniq<BoundColumnRefExpression>(cond->return_type, ColumnBinding(proj_index, expressions.size()));
51+
expressions.push_back(std::move(cond));
52+
} else {
53+
ProjectionBinder proj_binder(*this, context, proj_index, expressions, "WHERE clause");
54+
proj_binder.target_type = LogicalType::BOOLEAN;
55+
auto cond = proj_binder.Bind(action.condition);
56+
result->condition = std::move(cond);
57+
}
4858
}
4959
switch (action.action_type) {
5060
case MergeActionType::MERGE_UPDATE: {

src/duckdb/src/storage/table/column_data.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,8 @@ bool PersistentCollectionData::HasUpdates() const {
868868
}
869869

870870
PersistentColumnData ColumnData::Serialize() {
871-
PersistentColumnData result(type.InternalType(), GetDataPointers());
871+
auto result = count ? PersistentColumnData(type.InternalType(), GetDataPointers())
872+
: PersistentColumnData(type.InternalType());
872873
result.has_updates = HasUpdates();
873874
return result;
874875
}

0 commit comments

Comments
 (0)