Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PredicateExtractor not support String Expression #2123

Closed
kofkyobsa opened this issue Mar 28, 2019 · 1 comment
Closed

PredicateExtractor not support String Expression #2123

kofkyobsa opened this issue Mar 28, 2019 · 1 comment
Assignees

Comments

@kofkyobsa
Copy link

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants