You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "strongduanmu (via GitHub)" <gi...@apache.org> on 2023/05/02 23:50:30 UTC

[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #25424: Support for boolean primary MySQL queries

strongduanmu commented on code in PR #25424:
URL: https://github.com/apache/shardingsphere/pull/25424#discussion_r1183135965


##########
kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/BinaryOperationExpressionConverter.java:
##########
@@ -86,10 +89,12 @@ public Optional<SqlNode> convert(final BinaryOperationExpression segment) {
     
     private List<SqlNode> convertSqlNodes(final BinaryOperationExpression segment) {
         SqlNode left = new ExpressionConverter().convert(segment.getLeft()).orElseThrow(IllegalStateException::new);
-        SqlNode right = new ExpressionConverter().convert(segment.getRight()).orElseThrow(IllegalStateException::new);
         List<SqlNode> result = new LinkedList<>();
         result.add(left);
-        result.addAll(right instanceof SqlNodeList ? ((SqlNodeList) right).getList() : Collections.singletonList(right));
+        if (segment.getRight() != null) {

Review Comment:
   Please put null condition on the left hand.



##########
sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java:
##########
@@ -474,12 +481,17 @@ private ASTNode createAssignmentSegment(final BooleanPrimaryContext ctx) {
     private ASTNode createCompareSegment(final BooleanPrimaryContext ctx) {
         ExpressionSegment left = (ExpressionSegment) visit(ctx.booleanPrimary());
         ExpressionSegment right;
+        String operator;
+        if (null != ctx.ALL()) {

Review Comment:
   It seems that this parse logic change has impacted encrypt like feature.



-- 
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