jiangtao69039 opened a new issue, #24637:
URL: https://github.com/apache/shardingsphere/issues/24637

   #24532  Branches added to **BaseRule.g4/castFunction** may crash in a null 
pointer. because **ctx.dataType()**  my not exist.
   ```java 
    @Override
       public final ASTNode visitCastFunction(final CastFunctionContext ctx) {
           calculateParameterCount(ctx.expr());
           FunctionSegment result = new 
FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), 
ctx.CAST().getText(), getOriginalText(ctx));
           for (ExprContext each : ctx.expr()) {
               ASTNode expr = visit(each);
               if (expr instanceof ColumnSegment) {
                   result.getParameters().add((ColumnSegment) expr);
               } else if (expr instanceof LiteralExpressionSegment) {
                   result.getParameters().add((LiteralExpressionSegment) expr);
               }
           }
           result.getParameters().add((DataTypeSegment) visit(ctx.dataType()));
           return result;
       }
   ```
   
   
![image](https://user-images.githubusercontent.com/20572131/225510989-7b6062e7-9321-4f1e-b87a-970f2b5b58ca.png)
   


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