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

   **This is my configuration**
   
   ```yaml
   spring:
     shardingsphere:
       datasource:
         names: master,slave
         master:
           driver-class-name: com.mysql.cj.jdbc.Driver
           type: com.alibaba.druid.pool.DruidDataSource
           url:  #
           username: #
           password: #
         slave:
           driver-class-name: com.mysql.cj.jdbc.Driver
           type: com.alibaba.druid.pool.DruidDataSource
           url:  #
           username: #
           password: #
       props:
         sql-show: true
       rules:
         readwrite-splitting:
           data-sources:
             read-write-datasource:
               load-balancer-name: round-robin
               static-strategy:
                 write-data-source-name: master
                 read-data-source-names: slave
           load-balancers:
             round-robin:
               type: ROUND_ROBIN
         sharding:
           key-generators:
             snowflake:
               props:
                 max-vibration-offset: 2048
                 worker-id: 1
                 sql.show: true
               type: SNOWFLAKE
           sharding-algorithms:
             tbstrategy:
               props:
                 algorithm-expression: blacklist_$->{Long.valueOf(mobile) % 10 
+ 1}
               type: INLINE
           tables:
             blacklist:
               actual-data-nodes: master.blacklist_$->{1..10}
               key-generate-strategy:
                 column: id
                 key-generator-name: snowflake
               table-strategy:
                 standard:
                   sharding-algorithm-name: tbstrategy
                   sharding-column: mobile
   ```
   
   If it's not a sharding table, you can use slave
   
   ```text
   Logic SQL: SELECT  
   
id,menu_name,icon,parent_id,ordered,method,menu_type,path,component,menu_name,perms,create_time
     FROM system_menu 
    WHERE  is_deleted=0
   
   Actual SQL: slave ::: SELECT  
   
id,menu_name,icon,parent_id,ordered,method,menu_type,path,component,menu_name,perms,create_time
     FROM system_menu 
    WHERE  is_deleted=0
   ```
   
   If it is a sharding table, read write separation fails
   ```text
   Logic SQL: SELECT  id,mobile  FROM blacklist 
    
    WHERE (mobile = ?)
   
   Actual SQL: master ::: SELECT  id,mobile  FROM blacklist_4 
    
    WHERE (mobile = ?) ::: [13800138000]
   ```
   
   Using version
   ```xml
           <!-- shardingJDBC-->
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
               <version>5.2.0</version>
           </dependency>
   ```
   
   May I ask if this is a bug or a configuration error


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