Oliver-GMJ commented on issue #26922:
URL: 
https://github.com/apache/shardingsphere/issues/26922#issuecomment-1637312630

   @strongduanmu Thanks.
   
   1. It works after set `SINGLE TABLE`.
   ```yml
   rules:
     - !SINGLE
       tables:
         - master.public.*
     - !SHARDING
     tables:
       tb_shard:
         actualDataNodes: master.tb_shard_error
         tableStrategy:
           complex:
             shardingAlgorithmName: my_complex_algorithm
             shardingColumns: col_1,col_2
   
     shardingAlgorithms:
       my_complex_algorithm:
         type: CLASS_BASED
         props:
           strategy: COMPLEX
           algorithmClassName: com.xxx.MyComplexShardingAlgorithm
   ```
   
   2. But I can't use any "BinaryOperation" such as +-*/%
   ```
   SELECT * FROM tb_demo ORDER BY id desc LIMIT #{pageSize} OFFSET (#{page} - 
1) * #{pageSize}
   ```
   Got SQL syntax error:
   ```
   Cause: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: 
You have an error in your SQL syntax:
       SELECT  
       id, name
       FROM tb_demo
       ORDER BY id desc
       LIMIT ? OFFSET (? - 1) * ?, no viable alternative at input '?-1)*?'
   at line 5, position 30, near [@32,193:192='<EOF>',<-1>,5:30]
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to