guowdxp opened a new issue #1813: The same sharding rule, sharding-proxy 3.0.0 
can query the data, sharding-proxy 3.1.0 can not query the data.
URL: https://github.com/apache/incubator-shardingsphere/issues/1813
 
 
   
   sharding-proxy config like this:
   
   
       trans_router:   
         actualDataNodes: 
ds_0.trans_router_000${0..1},ds_1.trans_router_000${2..3}
         databaseStrategy:
           inline:
             shardingColumn: trans_no
             algorithmExpression: ds_${(trans_no.hashCode().abs() % 
4).intdiv(2)}
         tableStrategy:
           inline:
             shardingColumn: trans_no
             algorithmExpression: trans_router_${"000" + 
(trans_no.hashCode().abs() % 4)}
   
   sql statement is as follows:
   
   
   
        select * from trans_router where trans_no = '63201810160018204385';
   
   If we use sharding-proxy version 3.0.0, we can query the results.
   If we use sharding-proxy version 3.1.0, we can't query the result.
   I debug the sharding-proxy 3.1.0 program and found the error in the 
AntlrParsingEngine class. Parsing the sql condition value in the 
AntlrParsingEngine class parse method is -1, the correct value should be 
63201810160018204385.
   
   code show as below:
   
        SQLStatement result = fillerEngine.fill(sqlSegments, ast.getRule());
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to