From d707ff752302cd9c9317c199e30d97ff59340927 Mon Sep 17 00:00:00 2001 From: Denis Hirn Date: Mon, 23 Sep 2024 08:12:31 +0200 Subject: [PATCH] Remove unnecessary add_filter flag --- src/include/duckdb/planner/subquery/rewrite_subquery.hpp | 1 - src/planner/subquery/rewrite_subquery.cpp | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/include/duckdb/planner/subquery/rewrite_subquery.hpp b/src/include/duckdb/planner/subquery/rewrite_subquery.hpp index 4d896fbcfba8..7ea07a86c733 100644 --- a/src/include/duckdb/planner/subquery/rewrite_subquery.hpp +++ b/src/include/duckdb/planner/subquery/rewrite_subquery.hpp @@ -52,7 +52,6 @@ class RewriteCorrelatedSubqueriesRecursive : public BoundNodeVisitor { idx_t subquery_depth = 0; ColumnBinding base_binding; const vector &correlated_columns; - bool add_filter = false; unique_ptr condition; column_binding_map_t &correlated_map; Binder *binder; diff --git a/src/planner/subquery/rewrite_subquery.cpp b/src/planner/subquery/rewrite_subquery.cpp index 1d2a94225ca1..7dcad3280047 100644 --- a/src/planner/subquery/rewrite_subquery.cpp +++ b/src/planner/subquery/rewrite_subquery.cpp @@ -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(col.name, col.type, outer_binding, col.depth + subquery_depth + lateral_depth); @@ -182,7 +179,6 @@ void RewriteCorrelatedSubqueriesRecursive::VisitBoundTableRef(BoundTableRef &ref } } } - } } // visit the children of the table ref BoundNodeVisitor::VisitBoundTableRef(ref);