Skip to content

Commit 61e82df

Browse files
chore: Update vendored sources to duckdb/duckdb@7f34190 (#576)
FIX: Discrepancy Between Count and Sum Queries in SQL (duckdb/duckdb#14634) Co-authored-by: krlmlr <[email protected]>
1 parent 186f0f9 commit 61e82df

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/duckdb/src/common/vector_operations/comparison_operators.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ static void NestedComparisonExecutor(Vector &left, Vector &right, Vector &result
167167
auto &result_validity = ConstantVector::Validity(result);
168168
SelectionVector true_sel(1);
169169
auto match_count = ComparisonSelector::Select<OP>(left, right, nullptr, 1, &true_sel, nullptr, result_validity);
170+
// since we are dealing with nested types where the values are not NULL, the result is always valid (i.e true or
171+
// false)
172+
result_validity.SetAllValid(1);
170173
auto result_data = ConstantVector::GetData<bool>(result);
171174
result_data[0] = match_count > 0;
172175
return;

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 "3-dev139"
2+
#define DUCKDB_PATCH_VERSION "3-dev142"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 1
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.1.3-dev139"
11+
#define DUCKDB_VERSION "v1.1.3-dev142"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "78b65d4a9a"
14+
#define DUCKDB_SOURCE_ID "7f34190f3f"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static bool FilterRemovesNull(ClientContext &context, ExpressionRewriter &rewrit
3131
unordered_set<idx_t> &right_bindings) {
3232
// make a copy of the expression
3333
auto copy = expr->Copy();
34-
// replace all BoundColumnRef expressions frmo the RHS with NULL constants in the copied expression
34+
// replace all BoundColumnRef expressions from the RHS with NULL constants in the copied expression
3535
copy = ReplaceColRefWithNull(std::move(copy), right_bindings);
3636

3737
// attempt to flatten the expression by running the expression rewriter on it
@@ -97,6 +97,9 @@ unique_ptr<LogicalOperator> FilterPushdown::PushdownLeftJoin(unique_ptr<LogicalO
9797
// bindings match right side or both sides: we cannot directly push it into the right
9898
// however, if the filter removes rows with null values from the RHS we can turn the left outer join
9999
// in an inner join, and then push down as we would push down an inner join
100+
// Edit: This is only possible if the bindings match BOTH sides, so the filter can be pushed down to both
101+
// children. If the filter can only be applied to the right side, and the filter filters
102+
// all tuples, then the inner join cannot be converted.
100103
if (FilterRemovesNull(optimizer.context, optimizer.rewriter, filters[i]->filter.get(), right_bindings)) {
101104
// the filter removes NULL values, turn it into an inner join
102105
join.join_type = JoinType::INNER;

0 commit comments

Comments
 (0)