You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/03/28 07:41:20 UTC
[GitHub] [incubator-shardingsphere] kofkyobsa opened a new issue #2123:
PredicateExtractor not support String Expression
kofkyobsa opened a new issue #2123: PredicateExtractor not support String Expression
URL: https://github.com/apache/incubator-shardingsphere/issues/2123
sharding jdbc & proxy
version:3.1.0
when i use sql like
" select snapshot_no from pt_item_base_snapshot where snapshot_no ='20190304152137155168409726302111' "
sharding-sphere can't get the value of column snapshot_no correctly
, it's always be -1;
I debug the source code ,in the class **PredicateExtractor** ,the method **buildExpression**
only support number:
` Optional<ParserRuleContext> bitExprNode = ExtractorUtils.findFirstChildNode(valueNode, RuleName.BIT_EXPR);
expressionNode = ExtractorUtils.findFirstChildNode(valueNode, RuleName.NUMBER);
if (expressionNode.isPresent() && (!bitExprNode.isPresent() || 1 == bitExprNode.get().getChildCount())) {
commonExpressionSegment.setValue(NumberUtil.getExactlyNumber(expressionNode.get().getText(), 10));
}`
if I change code like ' expressionNode = ExtractorUtils.findFirstChildNode(valueNode, RuleName.STRING);' , the sql going well !
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services