From ff9810f89c7a170a81d182b9f894ca5310872800 Mon Sep 17 00:00:00 2001 From: Denis Hirn Date: Mon, 23 Sep 2024 15:06:52 +0200 Subject: [PATCH] Revert unrelated changes --- src/include/duckdb/planner/binder.hpp | 5 ----- src/planner/binder/query_node/bind_cte_node.cpp | 2 -- src/planner/binder/query_node/bind_recursive_cte_node.cpp | 2 -- src/planner/binder/tableref/bind_basetableref.cpp | 3 --- src/planner/subquery/flatten_dependent_join.cpp | 3 --- 5 files changed, 15 deletions(-) diff --git a/src/include/duckdb/planner/binder.hpp b/src/include/duckdb/planner/binder.hpp index 69477144490d..cdfc67d1b711 100644 --- a/src/include/duckdb/planner/binder.hpp +++ b/src/include/duckdb/planner/binder.hpp @@ -114,7 +114,6 @@ class Binder : public enable_shared_from_this { optional_ptr> lambda_bindings; unordered_map recursive_ctes; - unordered_map bound_cte_nodes; public: DUCKDB_API BoundStatement Bind(SQLStatement &statement); @@ -211,10 +210,6 @@ class Binder : public enable_shared_from_this { StatementProperties &GetStatementProperties(); - shared_ptr GetParentBinder() { - return parent; - } - private: //! The parent binder (if any) shared_ptr parent; diff --git a/src/planner/binder/query_node/bind_cte_node.cpp b/src/planner/binder/query_node/bind_cte_node.cpp index 8e6e2527eeca..cd61b03e8c0a 100644 --- a/src/planner/binder/query_node/bind_cte_node.cpp +++ b/src/planner/binder/query_node/bind_cte_node.cpp @@ -26,8 +26,6 @@ unique_ptr Binder::BindCTE(CTENode &statement) { result->ctename = statement.ctename; result->setop_index = GenerateTableIndex(); - bound_cte_nodes[result->setop_index] = result.get(); - result->query_binder = Binder::CreateBinder(context, this); result->query = result->query_binder->BindNode(*statement.query); diff --git a/src/planner/binder/query_node/bind_recursive_cte_node.cpp b/src/planner/binder/query_node/bind_recursive_cte_node.cpp index 5305fea7bdab..1c5e342615b0 100644 --- a/src/planner/binder/query_node/bind_recursive_cte_node.cpp +++ b/src/planner/binder/query_node/bind_recursive_cte_node.cpp @@ -20,8 +20,6 @@ unique_ptr Binder::BindNode(RecursiveCTENode &statement) { result->union_all = statement.union_all; result->setop_index = GenerateTableIndex(); - bound_cte_nodes[result->setop_index] = result.get(); - result->left_binder = Binder::CreateBinder(context, this); result->left = result->left_binder->BindNode(*statement.left); diff --git a/src/planner/binder/tableref/bind_basetableref.cpp b/src/planner/binder/tableref/bind_basetableref.cpp index 0edddbf6f445..40f2662d4500 100644 --- a/src/planner/binder/tableref/bind_basetableref.cpp +++ b/src/planner/binder/tableref/bind_basetableref.cpp @@ -13,8 +13,6 @@ #include "duckdb/planner/operator/logical_get.hpp" #include "duckdb/planner/tableref/bound_basetableref.hpp" #include "duckdb/planner/tableref/bound_cteref.hpp" -#include "duckdb/planner/query_node/bound_recursive_cte_node.hpp" -#include "duckdb/planner/query_node/bound_cte_node.hpp" #include "duckdb/planner/tableref/bound_dummytableref.hpp" #include "duckdb/planner/tableref/bound_subqueryref.hpp" @@ -122,7 +120,6 @@ unique_ptr Binder::Bind(BaseTableRef &ref) { result->types = ctebinding->types; result->bound_columns = std::move(names); - return std::move(result); } else { if (CTEIsAlreadyBound(cte)) { diff --git a/src/planner/subquery/flatten_dependent_join.cpp b/src/planner/subquery/flatten_dependent_join.cpp index a74aab38c1da..9c40f76a189c 100644 --- a/src/planner/subquery/flatten_dependent_join.cpp +++ b/src/planner/subquery/flatten_dependent_join.cpp @@ -209,7 +209,6 @@ unique_ptr FlattenDependentJoins::PushDownDependentJoinInternal base_binding.table_index = proj.table_index; this->delim_offset = base_binding.column_index = plan->expressions.size() - correlated_columns.size(); this->data_offset = 0; - return plan; } case LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY: { @@ -432,7 +431,6 @@ unique_ptr FlattenDependentJoins::PushDownDependentJoinInternal // push the child into the LHS plan->children[0] = PushDownDependentJoinInternal(std::move(plan->children[0]), parent_propagate_null_values, lateral_depth); - // rewrite expressions in the join conditions RewriteCorrelatedExpressions rewriter(base_binding, correlated_map, lateral_depth); rewriter.VisitOperator(*plan); @@ -481,7 +479,6 @@ unique_ptr FlattenDependentJoins::PushDownDependentJoinInternal logical_any_join.condition = std::move(conjunction); } } - // then we replace any correlated expressions with the corresponding entry in the correlated_map RewriteCorrelatedExpressions rewriter(right_binding, correlated_map, lateral_depth); rewriter.VisitOperator(*plan);