shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

actualDataNodes is wrong when ModShardingAlgorithm's zeroPadding is true

Open Aresxue opened this issue 1 year ago • 1 comments

Which version of ShardingSphere did you use?

5.4.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

Expected behavior

When ModShardingAlgorithm is used and zeroPadding is true and the shards exceed 10, the first shard of table user should be user_00

Actual behavior

the first shard of table user be user_0

Reason analyze (If you can)

For the scenario where zeroPadding of ModShardingAlgorithm is true, org.apache.shardingsphere.infra.datanode.DataNodeUtils#getFormatDataNodes should be adjusted accordingly.

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

Aresxue avatar Apr 29 '24 05:04 Aresxue

Can you provide the complete config file you used? I can't reproduce this problem now @Aresxue

csonezp avatar Jul 08 '24 13:07 csonezp