From 3f8ca6b608456d3824acf8dd3d5ae40b30c02430 Mon Sep 17 00:00:00 2001 From: DuckDB Labs GitHub Bot Date: Fri, 9 Jan 2026 07:05:51 +0000 Subject: [PATCH] Update vendored DuckDB sources to 23dcc0f1f6 --- .../src/execution/column_binding_resolver.cpp | 8 ++++ src/duckdb/src/execution/join_hashtable.cpp | 44 ++++++++++++------- .../function/table/version/pragma_version.cpp | 6 +-- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/duckdb/src/execution/column_binding_resolver.cpp b/src/duckdb/src/execution/column_binding_resolver.cpp index d9730eb85..8c8af7873 100644 --- a/src/duckdb/src/execution/column_binding_resolver.cpp +++ b/src/duckdb/src/execution/column_binding_resolver.cpp @@ -42,6 +42,14 @@ void ColumnBindingResolver::VisitOperator(LogicalOperator &op) { // for now, only ASOF supports this. if (comp_join.predicate) { D_ASSERT(op.type == LogicalOperatorType::LOGICAL_ASOF_JOIN); + // If this is a SEMI or ANTI join and we have an arbitrary predicate, + // we need to include the bindings of the RHS + if (comp_join.join_type == JoinType::SEMI || comp_join.join_type == JoinType::ANTI) { + auto right_bindings = op.children[1]->GetColumnBindings(); + bindings.insert(bindings.end(), right_bindings.begin(), right_bindings.end()); + auto &right_types = op.children[1]->types; + types.insert(types.end(), right_types.begin(), right_types.end()); + } VisitExpression(&comp_join.predicate); } return; diff --git a/src/duckdb/src/execution/join_hashtable.cpp b/src/duckdb/src/execution/join_hashtable.cpp index aca687132..1d9370159 100644 --- a/src/duckdb/src/execution/join_hashtable.cpp +++ b/src/duckdb/src/execution/join_hashtable.cpp @@ -1130,25 +1130,35 @@ void ScanStructure::NextRightSemiOrAntiJoin(DataChunk &keys) { // resolve the equality_predicates for this set of keys idx_t result_count = ResolvePredicates(keys, chain_match_sel_vector, nullptr); - // for each match, fully follow the chain - for (idx_t i = 0; i < result_count; i++) { - const auto idx = chain_match_sel_vector.get_index(i); - auto &ptr = ptrs[idx]; - if (Load(ptr + ht.tuple_size)) { // Early out: chain has been fully marked as found before - ptr = ht.dead_end.get(); - continue; - } + if (ht.non_equality_predicates.empty()) { + // we only have equality predicates - the match is found for the entire chain + for (idx_t i = 0; i < result_count; i++) { + const auto idx = chain_match_sel_vector.get_index(i); + auto &ptr = ptrs[idx]; + if (Load(ptr + ht.tuple_size)) { // Early out: chain has been fully marked as found before + ptr = ht.dead_end.get(); + continue; + } - // Fully mark chain as found - while (true) { - // NOTE: threadsan reports this as a data race because this can be set concurrently by separate threads - // Technically it is, but it does not matter, since the only value that can be written is "true" - Store(true, ptr + ht.tuple_size); - auto next_ptr = LoadPointer(ptr + ht.pointer_offset); - if (!next_ptr) { - break; + // Fully mark chain as found + while (true) { + // NOTE: threadsan reports this as a data race because this can be set concurrently by separate + // threads Technically it is, but it does not matter, since the only value that can be written is + // "true" + Store(true, ptr + ht.tuple_size); + auto next_ptr = LoadPointer(ptr + ht.pointer_offset); + if (!next_ptr) { + break; + } + ptr = next_ptr; } - ptr = next_ptr; + } + } else { + // we have non-equality predicates - we need to evaluate the join condition for every row + // for each match found in the current pass - mark the match as found + for (idx_t i = 0; i < result_count; i++) { + auto idx = chain_match_sel_vector.get_index(i); + Store(true, ptrs[idx] + ht.tuple_size); } } diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index 61f6944cc..782227c4e 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 "4-dev168" +#define DUCKDB_PATCH_VERSION "4-dev173" #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.4-dev168" +#define DUCKDB_VERSION "v1.4.4-dev173" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "908d3eb281" +#define DUCKDB_SOURCE_ID "23dcc0f1f6" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp"