You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2020/09/15 23:33:15 UTC
[shardingsphere] branch master updated: Fix #6643
This is an automated email from the ASF dual-hosted git repository.
menghaoran 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 4fb7ea2 Fix #6643
new 4857d7e Merge pull request #7468 from terrymanu/dev
4fb7ea2 is described below
commit 4fb7ea269d59e25a1719ad74e95030bda7ea0744
Author: terrymanu <te...@163.com>
AuthorDate: Tue Sep 15 23:38:57 2020 +0800
Fix #6643
---
.../sql/parser/binder/segment/select/projection/Projection.java | 2 +-
.../segment/select/projection/engine/ProjectionsContextEngine.java | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/Projection.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/Projection.java
index 37f06b1..b6ababb 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/Projection.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/Projection.java
@@ -37,7 +37,7 @@ public interface Projection {
* @return alias
*/
Optional<String> getAlias();
-
+
/**
* Get columnLabel.
*
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/engine/ProjectionsContextEngine.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/engine/ProjectionsContextEngine.java
index 6ecce29..b282f2e 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/engine/ProjectionsContextEngine.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/segment/select/projection/engine/ProjectionsContextEngine.java
@@ -34,6 +34,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.In
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.OrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.TextOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtil;
import java.util.Collection;
import java.util.LinkedList;
@@ -180,7 +181,8 @@ public final class ProjectionsContextEngine {
}
private boolean isSameAlias(final Projection projection, final TextOrderByItemSegment orderItem) {
- return projection.getAlias().isPresent() && (orderItem.getText().equalsIgnoreCase(projection.getAlias().get()) || orderItem.getText().equalsIgnoreCase(projection.getExpression()));
+ return projection.getAlias().isPresent()
+ && (SQLUtil.getExactlyValue(orderItem.getText()).equalsIgnoreCase(projection.getAlias().get()) || orderItem.getText().equalsIgnoreCase(projection.getExpression()));
}
private boolean isSameQualifiedName(final Projection projection, final TextOrderByItemSegment orderItem) {