wjh0258 opened a new issue #11147:
URL: https://github.com/apache/shardingsphere/issues/11147


   Shardingsphere proxy 5.0 beta 
   
   table t_test2  does not specify the specific table's  database rule in the 
partition rule, so the default  database rule is not used
   
   Now table t_test2  always route to database ds_1.
   
   I expect table t_test2  route to database  ds_${tenant_id}
    defaultDatabaseStrategy:
       standard:
         shardingColumn: tenant_id
         shardingAlgorithmName: database_inline
   
   
   
###################################################################################################
   
   schemaName: policy
   
   dataSources:
     ds_0:
       url: jdbc:mysql://127.0.0.1:3306/policy?serverTimezone=UTC&useSSL=false
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
   
     ds_2:
       url: jdbc:mysql://127.0.0.1:3306/policy_2?serverTimezone=UTC&useSSL=false
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
     ds_1:
       url: jdbc:mysql://127.0.0.1:3306/policy_1?serverTimezone=UTC&useSSL=false
       username: root
       password: root
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: ds_${0..2}.t_order_${0..1}
         databaseStrategy:
           standard:
             shardingColumn: tenant_id
             shardingAlgorithmName: database_inline
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_inline
         keyGenerateStrategy:
           column: order_id
           keyGeneratorName: snowflake
       t_test:
         actualDataNodes: ds_${0..2}.t_test
       t_order_item:
         actualDataNodes: ds_${0..2}.t_order_item_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_item_inline
         keyGenerateStrategy:
           column: order_item_id
           keyGeneratorName: snowflake
     bindingTables:
       - t_order,t_order_item
     defaultDatabaseStrategy:
       standard:
         shardingColumn: tenant_id
         shardingAlgorithmName: database_inline
     defaultTableStrategy: 
       none:
     broadcastTables:
       - t_test2
       
     shardingAlgorithms:
       default_database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${tenant_id}
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${tenant_id}
       t_order_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_${order_id % 2}
       t_order_item_inline:
         type: INLINE
         props:
          algorithm-expression: t_order_item_${order_id % 2}
     
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 123
   


-- 
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-unsubscr...@shardingsphere.apache.org

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


Reply via email to