shardingsphere
shardingsphere copied to clipboard
No error exception when creating a sharding strategy by using a inconsistent type from the sharding algorithm type
Bug Report
Which version of ShardingSphere did you use?
master 9c83948cdb49af429851eb2eca9ce10da9dfb7a7
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
Expected behavior
Error exception by Invalid algorithms.
Actual behavior
Successful created sharding strategy with no exception.
Reason analyze (If you can)
The type verification of the type of the sharding strategy and the sharding algorithm may not be perfect.
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
- add resource
ADD RESOURCE resource_0 (
HOST="127.0.0.1",
PORT=3306,
DB="db0",
USER="root",
PASSWORD="123456"
);
- create sharding algorithm
CREATE SHARDING ALGORITHM database_inline
(TYPE(NAME="inline",PROPERTIES("algorithm-expression"="t_order_item_${order_id % 2}")));
- create sharding strategy
CREATE DEFAULT SHARDING DATABASE STRATEGY
(TYPE="hint",SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=database_inline);
Comments
In this issue, a sharding strategy of type hint is created using the inline sharding algorithm(the type should be standard). It's just an example . It does not mean that the problem only occurs in the inline algorithm and the hint type, the other two types(standard, complex) also have the same problem.
Hi @Qianyi951015 I found @sunkai-cai is working on the same issue. Refer to #20777.
Hello , this issue has not received a reply for several days. This issue is supposed to be closed.
Hi @Qianyi951015 , I think this issue has been fixed by #22926, could you check it?
Hi @Qianyi951015 , I think this issue has been fixed by #22926, could you check it?
sure i will check it
Hi @RaigorJiang I dont think this issue was fully fixed, as the figure shows below there is still no error exception when I was creating default sharding strategy by using inline
algorithm with hint
type
@Qianyi951015
Thank you, what about CREATE SHARDING TABLE RULE
?
@RaigorJiang same
@Qianyi951015 Thank you for your verification, I will continue to investigate.