Loading sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/ExpressionExtractor.java +2 −2 Original line number Diff line number Diff line Loading @@ -91,11 +91,11 @@ public final class ExpressionExtractor implements OptionalSQLSegmentExtractor { if (bitExprNode.isPresent() && 1 != bitExprNode.get().getChildCount()) { return result; } Optional<ParserRuleContext> numberNode = ExtractorUtils.findFirstChildNode(expressionNode, RuleName.NUMBER); Optional<ParserRuleContext> numberNode = ExtractorUtils.findFirstChildNode(expressionNode, RuleName.NUMBER_LITERALS); if (numberNode.isPresent()) { result.setLiterals(NumberUtil.getExactlyNumber(numberNode.get().getText(), 10)); } Optional<ParserRuleContext> stringNode = ExtractorUtils.findFirstChildNode(expressionNode, RuleName.STRING); Optional<ParserRuleContext> stringNode = ExtractorUtils.findFirstChildNode(expressionNode, RuleName.STRING_LITERALS); if (stringNode.isPresent()) { String text = stringNode.get().getText(); result.setLiterals(text.substring(1, text.length() - 1)); Loading sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/OrderByItemExtractor.java +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public final class OrderByItemExtractor implements CollectionSQLSegmentExtractor Collection<OrderByItemSegment> result = new LinkedList<>(); for (ParserRuleContext each : ExtractorUtils.getAllDescendantNodes(ancestorNode, RuleName.ORDER_BY_ITEM)) { OrderDirection orderDirection = 2 == each.getChildCount() && OrderDirection.DESC.name().equalsIgnoreCase(each.getChild(1).getText()) ? OrderDirection.DESC : OrderDirection.ASC; Optional<ParserRuleContext> indexNode = ExtractorUtils.findFirstChildNode(each, RuleName.NUMBER); Optional<ParserRuleContext> indexNode = ExtractorUtils.findFirstChildNode(each, RuleName.NUMBER_LITERALS); if (indexNode.isPresent()) { result.add(new IndexOrderByItemSegment(NumberUtil.getExactlyNumber(indexNode.get().getText(), 10).intValue(), orderDirection, OrderDirection.ASC)); continue; Loading Loading
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/ExpressionExtractor.java +2 −2 Original line number Diff line number Diff line Loading @@ -91,11 +91,11 @@ public final class ExpressionExtractor implements OptionalSQLSegmentExtractor { if (bitExprNode.isPresent() && 1 != bitExprNode.get().getChildCount()) { return result; } Optional<ParserRuleContext> numberNode = ExtractorUtils.findFirstChildNode(expressionNode, RuleName.NUMBER); Optional<ParserRuleContext> numberNode = ExtractorUtils.findFirstChildNode(expressionNode, RuleName.NUMBER_LITERALS); if (numberNode.isPresent()) { result.setLiterals(NumberUtil.getExactlyNumber(numberNode.get().getText(), 10)); } Optional<ParserRuleContext> stringNode = ExtractorUtils.findFirstChildNode(expressionNode, RuleName.STRING); Optional<ParserRuleContext> stringNode = ExtractorUtils.findFirstChildNode(expressionNode, RuleName.STRING_LITERALS); if (stringNode.isPresent()) { String text = stringNode.get().getText(); result.setLiterals(text.substring(1, text.length() - 1)); Loading
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/OrderByItemExtractor.java +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public final class OrderByItemExtractor implements CollectionSQLSegmentExtractor Collection<OrderByItemSegment> result = new LinkedList<>(); for (ParserRuleContext each : ExtractorUtils.getAllDescendantNodes(ancestorNode, RuleName.ORDER_BY_ITEM)) { OrderDirection orderDirection = 2 == each.getChildCount() && OrderDirection.DESC.name().equalsIgnoreCase(each.getChild(1).getText()) ? OrderDirection.DESC : OrderDirection.ASC; Optional<ParserRuleContext> indexNode = ExtractorUtils.findFirstChildNode(each, RuleName.NUMBER); Optional<ParserRuleContext> indexNode = ExtractorUtils.findFirstChildNode(each, RuleName.NUMBER_LITERALS); if (indexNode.isPresent()) { result.add(new IndexOrderByItemSegment(NumberUtil.getExactlyNumber(indexNode.get().getText(), 10).intValue(), orderDirection, OrderDirection.ASC)); continue; Loading