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

zhangyonglun 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 8efeaaf  fix parse of PostgreSQL table (#7499)
8efeaaf is described below

commit 8efeaaf0d45cbd9638666f0aadbccd551e1e52db
Author: JingShang Lu <[email protected]>
AuthorDate: Thu Sep 17 15:03:11 2020 +0800

    fix parse of PostgreSQL table (#7499)
---
 .../sql/parser/postgresql/visitor/impl/PostgreSQLDMLVisitor.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/impl/PostgreSQLDMLVisitor.java
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/impl/PostgreSQLDMLVisitor.java
index c0f3dfc..845d79a 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/impl/PostgreSQLDMLVisitor.java
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/impl/PostgreSQLDMLVisitor.java
@@ -494,6 +494,7 @@ public final class PostgreSQLDMLVisitor extends 
PostgreSQLVisitor implements DML
         }
         if (null != ctx.tableReference()) {
             JoinTableSegment result = new JoinTableSegment();
+            result.setLeft((TableSegment) visit(ctx.tableReference()));
             int startIndex = null != ctx.LP_() ? 
ctx.LP_().getSymbol().getStartIndex() : 
ctx.tableReference().start.getStartIndex();
             int stopIndex = 0;
             AliasSegment alias = null;
@@ -513,9 +514,8 @@ public final class PostgreSQLDMLVisitor extends 
PostgreSQLVisitor implements DML
         return new SimpleTableSegment(ctx.start.getStartIndex(), 
ctx.stop.getStopIndex(), new IdentifierValue("not support"));
     }
     
-    private JoinTableSegment visitJoinedTable(final JoinedTableContext ctx, 
final TableSegment tableSegment) {
-        JoinTableSegment result = new JoinTableSegment();
-        result.setLeft(tableSegment);
+    private JoinTableSegment visitJoinedTable(final JoinedTableContext ctx, 
final JoinTableSegment tableSegment) {
+        JoinTableSegment result = tableSegment;
         TableSegment right = (TableSegment) visit(ctx.tableReference());
         result.setRight(right);
         if (null != ctx.joinQual()) {

Reply via email to