Skip to content

Commit

Permalink
Remove unnecessary add_filter flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kryonix committed Sep 23, 2024
1 parent 81fc22c commit d707ff7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion src/include/duckdb/planner/subquery/rewrite_subquery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class RewriteCorrelatedSubqueriesRecursive : public BoundNodeVisitor {
idx_t subquery_depth = 0;
ColumnBinding base_binding;
const vector<CorrelatedColumnInfo> &correlated_columns;
bool add_filter = false;
unique_ptr<Expression> condition;
column_binding_map_t<idx_t> &correlated_map;
Binder *binder;
Expand Down
6 changes: 1 addition & 5 deletions src/planner/subquery/rewrite_subquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,11 @@ void RewriteCorrelatedSubqueriesRecursive::VisitBoundTableRef(BoundTableRef &ref

D_ASSERT(found);

if (!add_filter) {
for (idx_t i = 0; i < correlated_columns.size(); i++) {
auto &col = correlated_columns[i];
auto col_copy = col;
col_copy.depth += lateral_depth + subquery_depth;
if (!add_filter) {
add_correlated_columns.push_back(col_copy);
}
add_correlated_columns.push_back(col_copy);

auto outer_binding = col.binding;
auto outer = make_uniq<BoundColumnRefExpression>(col.name, col.type, outer_binding, col.depth + subquery_depth + lateral_depth);
Expand All @@ -182,7 +179,6 @@ void RewriteCorrelatedSubqueriesRecursive::VisitBoundTableRef(BoundTableRef &ref
}
}
}
}
}
// visit the children of the table ref
BoundNodeVisitor::VisitBoundTableRef(ref);
Expand Down

0 comments on commit d707ff7

Please sign in to comment.