You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/04 03:20:06 UTC

[GitHub] [shardingsphere] KBCode opened a new issue, #21946: mysql limit sql rewrite question for masterslave

KBCode opened a new issue, #21946:
URL: https://github.com/apache/shardingsphere/issues/21946

   ## Question
   
   sharding config: 
   ```
   spring:
     shardingsphere:
       datasource:
         names: 'basic,order1,order2'
       sharding:
         default-data-source-name: basic
         master-slave-rules:
           order1:
             master-data-source-name: order1
             slave-data-source-names: basic
           order2:
             master-data-source-name: order2
             slave-data-source-names: basic
           basic:
             master-data-source-name: basic
             slave-data-source-names: basic
         tables:
           xxxx_record:
             actual-data-nodes: >-
               order$->{1..2}.xxxx_record
             database-strategy:
               complex:
                 sharding-columns: 'pk_id'
                 algorithm-class-name: >-
                   com.xxxx.sharding.jdbc.config.xxxDatabaseShardingAlgorithm
   ```
   Logic SQL: `select xxx from xxx_table WHERE  xxx  and exit_time >= ? and exit_time <= ? order by exit_time desc LIMIT 10,10`
   
   routeContext routeMapper [ logicName : actualName ] -> {"order1":"basic","order2":"basic"}
   
   executeRewrite return  executionUnits size 1 basic.
   
   Actual SQL: `select xxx from xxx_table WHERE  xxx  and exit_time >= ? and exit_time <= ? order by exit_time desc LIMIT 0,20`
   
   resultMerger queryResults size 1,no merge
   
   execute return rows size 20 ,  expect rows 10
     
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN closed issue #21946: mysql limit sql rewrite question for masterslave

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #21946: mysql limit sql rewrite question for masterslave
URL: https://github.com/apache/shardingsphere/issues/21946


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN commented on issue #21946: mysql limit sql rewrite question for masterslave

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #21946:
URL: https://github.com/apache/shardingsphere/issues/21946#issuecomment-1364848940

   This is expected behaviour. You may refer to
   https://shardingsphere.apache.org/document/current/en/reference/sharding/rewrite/#pagination-correction


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org