You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/05/09 01:56:16 UTC

[GitHub] [shardingsphere] sandynz opened a new issue, #17460: Table name is case-sensitive when altering sharding table rule by DistSQL

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master branch
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   Proxy
   
   ### Expected behavior
   Table name is case-insensitive when altering sharding table rule by DistSQL.
   
   ### Actual behavior
   Table name is case-sensitive.
   Error log:
   ```
   ERROR 1112 (C1112): sharding rules `[T_ORDER]` do not exist in database `scaling_db`.
   ```
   
   Operation details on Proxy:
   ```
   mysql> create database scaling_db;
   Query OK, 0 rows affected (0.20 sec)
   
   mysql> use scaling_db
   Database changed
   mysql> ADD RESOURCE ds_0 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_0?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=root,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> ), ds_1 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_1?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=root,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> );
   Query OK, 0 rows affected (1.02 sec)
   
   mysql> CREATE SHARDING TABLE RULE t_order(
       -> RESOURCES(ds_0,ds_1),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
       -> ), t_order_item(
       -> RESOURCES(ds_0,ds_1),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
       -> );
   Query OK, 0 rows affected (2.85 sec)
   
   mysql> CREATE TABLE t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
   Query OK, 0 rows affected (0.69 sec)
   
   mysql> CREATE TABLE t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
   Query OK, 0 rows affected (0.20 sec)
   
   mysql> ADD RESOURCE ds_2 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_10?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=root,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> ), ds_3 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_11?serverTimezone=UTC&useSSL=false",
       USER=root,
       PASSWORD=root,
       PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
   ), ds_4 (
       URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_12?serverTimezone=UTC&useSSL=false",
       USER=root,
       PASSWORD=root,
       PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
   );    ->     USER=root,
       ->     PASSWORD=root,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> ), ds_4 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_12?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=root,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> );
   Query OK, 0 rows affected (0.13 sec)
   
   mysql> ALTER SHARDING TABLE RULE T_ORDER(
       -> RESOURCES(ds_2,ds_3,ds_4),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=6)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
       -> );
   ERROR 1112 (C1112): sharding rules `[T_ORDER]` do not exist in database `scaling_db`.
   ```
   
   ### Reason analyze (If you can)
   
   ### 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] RaigorJiang closed issue #17460: Table name is case-sensitive when altering sharding table rule by DistSQL

Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #17460: Table name is case-sensitive when altering sharding table rule by DistSQL
URL: https://github.com/apache/shardingsphere/issues/17460


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


[GitHub] [shardingsphere] lanchengx commented on issue #17460: Table name is case-sensitive when altering sharding table rule by DistSQL

Posted by GitBox <gi...@apache.org>.
lanchengx commented on issue #17460:
URL: https://github.com/apache/shardingsphere/issues/17460#issuecomment-1121161358

   @sandynz  Thanks for your feedback, I will fix it.


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