wangtiga commented on code in PR #25033:
URL: https://github.com/apache/shardingsphere/pull/25033#discussion_r1159744678


##########
sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java:
##########
@@ -350,7 +350,7 @@ private Optional<String> findBinaryOperator(final 
AExprContext ctx) {
     }
     
     private BinaryOperationExpression 
createPatternMatchingOperationSegment(final AExprContext ctx) {
-        String operator = getOriginalText(ctx.patternMatchingOperator());
+        String operator = 
getOriginalText(ctx.patternMatchingOperator()).toUpperCase();

Review Comment:
   Shouldn't the BinaryOperationExpression operator be the operation pair of a 
binary operation expression?
   In SQL, logical operators `AND OR NOT LIKE` can be converted to uppercase, 
while other operators (comparison operators, arithmetic operators) have no 
effect after executing toUpperCase().
   Furthermore, I noticed that the operator in BinaryOperationExpression is 
directly assigned in MySQLStatementSQLVisitor, and I made this change based on 
its code.
   
   I have just started reading the Shardingsphere code recently, and if I 
misunderstand something, I hope you could provide me with detailed guidance. 
Thank you very much.
   
   
https://github.com/apache/shardingsphere/blob/5.3.1/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java#L512



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to