From 4228ef6aa5993c696faaae9eb4bc682f8192f00a Mon Sep 17 00:00:00 2001 From: chimyue Date: Tue, 17 Dec 2024 16:19:09 +0000 Subject: [PATCH] fix nlj inner path das rescan prune bug --- src/sql/optimizer/ob_join_order.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sql/optimizer/ob_join_order.cpp b/src/sql/optimizer/ob_join_order.cpp index ad0c1e852..03726db2b 100755 --- a/src/sql/optimizer/ob_join_order.cpp +++ b/src/sql/optimizer/ob_join_order.cpp @@ -5910,7 +5910,8 @@ int ObJoinOrder::compute_join_path_relationship(const JoinPath &first_path, { int ret = OB_SUCCESS; relation = DominateRelation::OBJ_EQUAL; - if (OB_ISNULL(get_plan()) || OB_ISNULL(first_path.right_path_) || OB_ISNULL(second_path.right_path_)) { + if (OB_ISNULL(get_plan()) || OB_ISNULL(first_path.right_path_) || OB_ISNULL(second_path.right_path_) + || OB_ISNULL(first_path.right_path_->parent_) || OB_ISNULL(second_path.right_path_->parent_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(ret), K(first_path.right_path_), K(second_path.right_path_)); } @@ -5944,7 +5945,8 @@ int ObJoinOrder::compute_join_path_relationship(const JoinPath &first_path, } if (OB_SUCC(ret) && DominateRelation::OBJ_EQUAL == relation - && first_path.is_nlj_with_param_down() && second_path.is_nlj_with_param_down()) { + && first_path.is_nlj_with_param_down() && second_path.is_nlj_with_param_down() + && first_path.right_path_->parent_->get_tables().equal(second_path.right_path_->parent_->get_tables())) { int64_t first_right_local_rescan = 0; int64_t second_right_local_rescan = 0; bool first_can_px_batch_rescan = false;