You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "strongduanmu (via GitHub)" <gi...@apache.org> on 2023/06/28 11:22:38 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue, #26667: ShardingRule init logic should check ShardingAlgorithm type to avoid wrong usage

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   [675b20b](https://github.com/apache/shardingsphere/commit/675b20bc7ff60541ce3f55c62b1ec9778453ea68)
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   When I config ShardingAutoTableAlgorithm `MOD` in `tables` config, it can throw exception.
   
   ```yaml
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: ds_${0..1}.t_order_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_inline
         keyGenerateStrategy:
           column: order_id
           keyGeneratorName: snowflake
       t_order_item:
         actualDataNodes: ds_${0..1}.t_order_item_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_item_inline
         keyGenerateStrategy:
           column: order_item_id
           keyGeneratorName: snowflake
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: database_inline
     defaultTableStrategy:
       none:
         
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 2}
       t_order_inline:
         type: MOD
         props:
           sharding-count: 2
       t_order_item_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item_${order_id % 2}
   
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
   ```
   
   ### Actual behavior
   
   Start proxy successfully.
   
   ### Reason analyze (If you can)
   
   Not check ShardingAlgorithm type when init ShardingRule.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


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

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


[GitHub] [shardingsphere] sandynz closed issue #26667: ShardingRule init logic should check ShardingAlgorithm type to avoid wrong usage

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz closed issue #26667: ShardingRule init logic should check ShardingAlgorithm type to avoid wrong usage
URL: https://github.com/apache/shardingsphere/issues/26667


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

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