You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "134130 (via GitHub)" <gi...@apache.org> on 2023/09/16 08:55:14 UTC
[GitHub] [shardingsphere] 134130 commented on a diff in pull request #27904: fix issue-27424 when the table contains case-sensitive fields
134130 commented on code in PR #27904:
URL: https://github.com/apache/shardingsphere/pull/27904#discussion_r1327934528
##########
features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngine.java:
##########
@@ -100,7 +100,7 @@ private void appendMissingShardingConditions(final InsertStatementContext sqlSta
return;
}
for (String each : allColumnNames) {
- if (!columnNames.contains(each) && !shardingRule.isGenerateKeyColumn(each, tableName) && shardingRule.findShardingColumn(each, tableName).isPresent()) {
+ if (!columnNames.contains(each.toLowerCase()) && !shardingRule.isGenerateKeyColumn(each, tableName) && shardingRule.findShardingColumn(each, tableName).isPresent()) {
Review Comment:
In my opinion, adapting column identifier to `lowercase` is not good choice. It looks just avoiding this issue.
We need to fix `getColumnNamesForInsertColumns` returns it's own identifier, not `lowercase`.
When just fixing with this way, it will be appeared on other case later.
--
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