From 7e3a5dd6d68f702aa76bb256e5f673eb8265dcbc Mon Sep 17 00:00:00 2001 From: lichangjiang Date: Fri, 28 Aug 2020 09:17:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20pG=E7=9A=84select=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E5=B8=A6orderby=E6=97=B6=E5=80=99=EF=BC=8C=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=87=BA=E6=9D=A5=E7=9A=84SQLOrderBy=E7=9A=84parent=E9=83=BD?= =?UTF-8?q?=E6=98=AFnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java b/src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java index 4f935cd44b..2ec1e88dbe 100644 --- a/src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java +++ b/src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java @@ -109,6 +109,9 @@ public class PGSelectQueryBlock extends SQLSelectQueryBlock implements PGSQLObje } public void setOrderBy(SQLOrderBy orderBy) { + if (orderBy.getParent() == null) { + orderBy.setParent(this); + } this.orderBy = orderBy; } From 370f9ac06eb181c104e8353b357bebc324ceca6f Mon Sep 17 00:00:00 2001 From: lichangjiang Date: Fri, 28 Aug 2020 09:17:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20pG=E7=9A=84select=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E5=B8=A6orderby=E6=97=B6=E5=80=99=EF=BC=8C=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=87=BA=E6=9D=A5=E7=9A=84SQLOrderBy=E7=9A=84parent=E9=83=BD?= =?UTF-8?q?=E6=98=AFnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java b/src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java index 4f935cd44b..8b62ce23c6 100644 --- a/src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java +++ b/src/main/java/com/alibaba/druid/sql/dialect/postgresql/ast/stmt/PGSelectQueryBlock.java @@ -109,6 +109,9 @@ public class PGSelectQueryBlock extends SQLSelectQueryBlock implements PGSQLObje } public void setOrderBy(SQLOrderBy orderBy) { + if (orderBy != null) { + orderBy.setParent(this); + } this.orderBy = orderBy; }