You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/01 06:33:30 UTC

[GitHub] [shardingsphere] tuichenchuxin commented on a diff in pull request #18097: fix when table alias case different throw NullPointException

tuichenchuxin commented on code in PR #18097:
URL: https://github.com/apache/shardingsphere/pull/18097#discussion_r886362390


##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java:
##########
@@ -129,7 +130,8 @@ private List<Boolean> getValueCaseSensitive(final QueryResult queryResult, final
     
     private boolean getValueCaseSensitiveFromTables(final QueryResult queryResult,
                                                     final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema, final int columnIndex) throws SQLException {
-        for (SimpleTableSegment each : selectStatementContext.getAllTables()) {
+        Collection<SimpleTableSegment> allTables = selectStatementContext.getAllTables();

Review Comment:
   There's no need to modify this file.



##########
shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/extractor/TableExtractor.java:
##########
@@ -260,7 +260,7 @@ public void extractTablesFromUpdate(final UpdateStatement updateStatement) {
      */
     public boolean needRewrite(final OwnerSegment owner) {
         for (TableSegment each : tableContext) {
-            if (owner.getIdentifier().getValue().equals(each.getAlias().orElse(null))) {
+            if (owner.getIdentifier().getValue().equalsIgnoreCase(each.getAlias().orElse(null))) {

Review Comment:
   Is this sql can be execute in different database. like postgres or oracle?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org