fenglex opened a new issue #10937:
URL: https://github.com/apache/shardingsphere/issues/10937


   使用以下配置项启动shardingsphere-jdbc-core-spring-boot-starter  
   
   使用shardingsphere-jdbc-core-spring-boot-starter 版本是5.0.0-beta
   spring-boot版本是2.5.0
   ```
   spring:
     shardingsphere:
       props:
         sql-show: true
       datasource:
         common:
           driver-class-name: com.mysql.jdbc.Driver
         names: ds
         ds:
           jdbc-url: jdbc:mysql://hk:3306/db_sharding
           username: root
           driver-class-name: com.mysql.jdbc.Driver
           password: 'nQCk'
           type: com.zaxxer.hikari.HikariDataSource
       rules:
         sharding:
           sharding-algorithms:
             table-inline:
               # 使用了内置的分片算法-INLINE
               type: HASH_MOD
               props:
                 sharding-count: 5
             database-inline:
               type: INLINE
               props:
                 algorithm-expression: ds
           tables:
             tb_data_value:
               actual-data-nodes: ds.tb_data_value$->{0..4}
               table-strategy:
                 standard:
                   sharding-column: data_code
                   sharding-algorithm-name: table-inline
               database-strategy:
                 standard:
                   sharding-column: id
                   sharding-algorithm-name: database-inline
       enabled: true
   ```
   
发现问题是因为使用yaml配置文件配置后,sharding-count在HashModShardingAlgorithm类中getShardingCount方法时this.props.getProperty("sharding-count")取到的值实际是null,因为yaml的
 sharding-count的类型成了integer类型造成的,希望能修复这个问题


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

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


Reply via email to