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/04/23 11:08:42 UTC
[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #25268: Support for substring, dual, spatial function
strongduanmu commented on code in PR #25268:
URL: https://github.com/apache/shardingsphere/pull/25268#discussion_r1174559029
##########
sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java:
##########
@@ -939,8 +946,13 @@ public final ASTNode visitPositionFunction(final PositionFunctionContext ctx) {
@Override
public final ASTNode visitSubstringFunction(final SubstringFunctionContext ctx) {
- calculateParameterCount(Collections.singleton(ctx.expr()));
- return new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), null == ctx.SUBSTR() ? ctx.SUBSTRING().getText() : ctx.SUBSTR().getText(), getOriginalText(ctx));
+ FunctionSegment result = new FunctionSegment(
+ ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), null == ctx.SUBSTR() ? ctx.SUBSTRING().getText() : ctx.SUBSTR().getText(), getOriginalText(ctx));
+ result.getParameters().add((ExpressionSegment) visit(ctx.expr()));
+ for (TerminalNode node : ctx.NUMBER_()) {
Review Comment:
Please rename node to each.
--
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