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

   ## Bug Report
   
   
   ### Which version of ShardingSphere did you use?
      5.0.0
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
    ShardingSphere-JDBC
   ### Expected behavior
      broadcastTables show effect 
   ### Actual behavior
      out of action
   ### Reason analyze (If you can)
      if table donot set like 'ds_${0..1} ' include all the dataSources, the 
broadcastTables will out of action
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
       1,change the tables : t_order2: actualDataNodes: ds_0.t_order2
       2, Execute broadcasttable sql(insert) statement
   ### Example codes for reproduce this issue (such as a github link).
   ``` yaml
   dataSources:
     ds_0:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: com.mysql.cj.jdbc.Driver
       jdbcUrl: 
jdbc:mysql://localhost:3306/ds0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true
       username: root
       password: 123456
       connectionTimeout: 30000
       idleTimeout: 30000
       maximumPoolSize: 10
       maxLifetime: 1800000
     ds_1:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: com.mysql.cj.jdbc.Driver
       jdbcUrl: 
jdbc:mysql://localhost:3306/ds1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true
       username: root
       password: 123456
       connectionTimeout: 30000
       idleTimeout: 30000
       maximumPoolSize: 10
       maxLifetime: 1800000
   
   rules:
     - !SHARDING
       tables:
            #t_order1:
            #actualDataNodes: ds_${0..1}.t_order1
         t_order1:
           actualDataNodes: ds_0.t_order1
       broadcastTables:
         [
             t_order2
         ]
       defaultDatabaseStrategy:
         standard:
           shardingColumn: user_id
           shardingAlgorithmName: database_inline
       defaultTableStrategy:
         none:
   
       shardingAlgorithms:
         database_inline:
           type: INLINE
           props:
             algorithm-expression: ds_${order_id % 2}
   
       keyGenerators:
         snowflake:
           type: SNOWFLAKE
           props:
             worker-id: 123
   
   props:
     sql-show: false
   ```
   
   ## creae table 
   
   ```sql
    CREATE TABLE `t_order1`  (
     `id` int NOT NULL AUTO_INCREMENT,
     `user_id` int NULL DEFAULT NULL,
     `order_id` int NULL DEFAULT NULL,
     `cloumn` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL 
DEFAULT NULL,
     PRIMARY KEY (`id`) USING BTREE
   ) ENGINE = InnoDB AUTO_INCREMENT = 1233452 CHARACTER SET = utf8mb4 COLLATE = 
utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
   
    CREATE TABLE `t_order2`  (
     `id` int NOT NULL AUTO_INCREMENT,
     `user_id` int NULL DEFAULT NULL,
     `order_id` int NULL DEFAULT NULL,
     `cloumn` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL 
DEFAULT NULL,
     PRIMARY KEY (`id`) USING BTREE
   ) ENGINE = InnoDB AUTO_INCREMENT = 1233452 CHARACTER SET = utf8mb4 COLLATE = 
utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
   ```
   
   ## insert sql
   
   ```
   insert into t_order2 (id,user_id,order_id,cloumn) values (7,7,7,7)
   
   ```
   
   
   


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