This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 14a75b7a2e6 Fixes the expression segment cannot find the outer table 
when binding. (#34015)
14a75b7a2e6 is described below

commit 14a75b7a2e695b99be0fce6e8999f588ab37e4c9
Author: Cong Hu <[email protected]>
AuthorDate: Thu Dec 12 10:29:43 2024 +0800

    Fixes the expression segment cannot find the outer table when binding. 
(#34015)
---
 RELEASE-NOTES.md                                                        | 1 +
 .../infra/binder/engine/segment/from/type/JoinTableSegmentBinder.java   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 4819f679f91..6416bae3536 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -53,6 +53,7 @@
 1. Sharding: Fixes SQL COUNT with GROUP BY to prevent incorrect row returns - 
[#33380](https://github.com/apache/shardingsphere/pull/33380)
 1. Sharding: Fixes avg, sum, min, max function return empty data when no query 
result return - [#33449](https://github.com/apache/shardingsphere/pull/33449)
 1. Encrypt: Fixes merge exception without encrypt rule in database - 
[#33708](https://github.com/apache/shardingsphere/pull/33708)
+1. SQL Binder: Fixes the expression segment cannot find the outer table when 
binding - [#34015](https://github.com/apache/shardingsphere/pull/34015)
 
 ### Change Logs
 
diff --git 
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/from/type/JoinTableSegmentBinder.java
 
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/from/type/JoinTableSegmentBinder.java
index b9fd36c93e3..20af49d9438 100644
--- 
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/from/type/JoinTableSegmentBinder.java
+++ 
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/segment/from/type/JoinTableSegmentBinder.java
@@ -73,7 +73,7 @@ public final class JoinTableSegmentBinder {
         result.setJoinType(segment.getJoinType());
         result.setLeft(TableSegmentBinder.bind(segment.getLeft(), 
binderContext, tableBinderContexts, outerTableBinderContexts));
         result.setRight(TableSegmentBinder.bind(segment.getRight(), 
binderContext, tableBinderContexts, outerTableBinderContexts));
-        
result.setCondition(ExpressionSegmentBinder.bind(segment.getCondition(), 
SegmentType.JOIN_ON, binderContext, tableBinderContexts, 
LinkedHashMultimap.create()));
+        
result.setCondition(ExpressionSegmentBinder.bind(segment.getCondition(), 
SegmentType.JOIN_ON, binderContext, tableBinderContexts, 
outerTableBinderContexts));
         result.setUsing(bindUsingColumns(segment.getUsing(), 
tableBinderContexts));
         result.getUsing().forEach(each -> 
binderContext.getUsingColumnNames().add(each.getIdentifier().getValue()));
         Map<String, ProjectionSegment> usingColumnsByNaturalJoin = 
Collections.emptyMap();

Reply via email to