shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

No error exception when creating a sharding strategy by using a inconsistent type from the sharding algorithm type

Open Qianyi951015 opened this issue 2 years ago • 1 comments

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.

  1. add resource
ADD RESOURCE resource_0 (
    HOST="127.0.0.1",
    PORT=3306,
    DB="db0",
    USER="root",
    PASSWORD="123456"
);
  1. create sharding algorithm
CREATE SHARDING ALGORITHM database_inline 
(TYPE(NAME="inline",PROPERTIES("algorithm-expression"="t_order_item_${order_id % 2}")));
  1. 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.

Qianyi951015 avatar Sep 19 '22 03:09 Qianyi951015

Hi @Qianyi951015 I found @sunkai-cai is working on the same issue. Refer to #20777.

RaigorJiang avatar Sep 22 '22 03:09 RaigorJiang

Hello , this issue has not received a reply for several days. This issue is supposed to be closed.

github-actions[bot] avatar Oct 08 '22 16:10 github-actions[bot]

Hi @Qianyi951015 , I think this issue has been fixed by #22926, could you check it?

RaigorJiang avatar Jan 31 '23 04:01 RaigorJiang

Hi @Qianyi951015 , I think this issue has been fixed by #22926, could you check it?

sure i will check it

Qianyi951015 avatar Jan 31 '23 04:01 Qianyi951015

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 image

Qianyi951015 avatar Jan 31 '23 06:01 Qianyi951015

@Qianyi951015 Thank you, what about CREATE SHARDING TABLE RULE?

RaigorJiang avatar Jan 31 '23 07:01 RaigorJiang

@RaigorJiang same image

Qianyi951015 avatar Jan 31 '23 07:01 Qianyi951015

@Qianyi951015 Thank you for your verification, I will continue to investigate.

RaigorJiang avatar Jan 31 '23 07:01 RaigorJiang