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

   分表已经成功了,但是绑定表始终无法生效,查询了各种文档,求助
   
   # 分库分表规则配置
   
spring.shardingsphere.rules.sharding.tables.order.actual-data-nodes=ds0.order_$->{0..19}
   
spring.shardingsphere.rules.sharding.tables.order.table-strategy.standard.sharding-column=login_name
   
spring.shardingsphere.rules.sharding.tables.order.table-strategy.standard.sharding-algorithm-name=order-hash-mod
   
spring.shardingsphere.rules.sharding.tables.order.key-generate-strategy.column=id
   
spring.shardingsphere.rules.sharding.tables.order.key-generate-strategy.key-generator-name=snowflake
   
spring.shardingsphere.rules.sharding.sharding-algorithms.order-hash-mod.type=HASH_MOD
   
spring.shardingsphere.rules.sharding.sharding-algorithms.order-hash-mod.props.sharding-count=20
   
   
spring.shardingsphere.rules.sharding.tables.order_item.actual-data-nodes=ds0.order_item_$->{0..19}
   
spring.shardingsphere.rules.sharding.tables.order_item.table-strategy.standard.sharding-column=login_name
   
spring.shardingsphere.rules.sharding.tables.order_item.table-strategy.standard.sharding-algorithm-name=order-item-hash-mod
   
spring.shardingsphere.rules.sharding.tables.order_item.key-generate-strategy.column=id
   
spring.shardingsphere.rules.sharding.tables.order_item.key-generate-strategy.key-generator-name=snowflake
   
spring.shardingsphere.rules.sharding.sharding-algorithms.order-item-hash-mod.type=HASH_MOD
   
spring.shardingsphere.rules.sharding.sharding-algorithms.order-item-hash-mod.props.sharding-count=20
   
   # 绑定表配置
   spring.shardingsphere.rules.sharding.binding-tables=order,order_item
   
   数据库 mysql 8 ,java 11,spring boot 2.7.0   <dependency>
                                                                               
<groupId>org.apache.shardingsphere</groupId>
                                                                              
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
                                                                               
<version>5.1.2</version>
                                                                            
</dependency>
   
   sql:     SELECT o.id
           FROM order o
           LEFT JOIN order-item i
             on o.login_name =  i.login_name   结果是:file 查了20个表,
   


-- 
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