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/01/15 06:40:31 UTC

[GitHub] [shardingsphere] TeslaCN opened a new issue #14796: ShardingSphere-Proxy empty rule with multiple DataSources cause some problems

TeslaCN opened a new issue #14796:
URL: https://github.com/apache/shardingsphere/issues/14796


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master - 1c844923a9f1da68f8d06934e3ee325f06717bc3
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   I think it's better to forbid configuring multiple DataSources under empty rule schema.
   
   ### Actual behavior
   
   ```
   mysql> use sharding_db;
   Database changed
   
   mysql> create table whereareyou (id bigint primary key, name varchar(100));
   Query OK, 0 rows affected (0.07 sec)
   
   mysql> show tables;
   +-----------------------+------------+
   | Tables_in_sharding_db | Table_type |
   +-----------------------+------------+
   | t_order_item_0        | BASE TABLE |
   | t_order_item_1        | BASE TABLE |
   | whereareyou           | BASE TABLE |
   +-----------------------+------------+
   3 rows in set (0.01 sec)
   
   mysql> insert into whereareyour (id,name) values (1, 'hi');
   ERROR 1146 (42S02): Table 'demo_ds_0.whereareyour' doesn't exist
   
   mysql> create table whereareyou (id bigint primary key, name varchar(100));
   ERROR 1050 (42S01): Table 'whereareyou' already exists
   
   mysql> insert into whereareyour (id,name) values (1, 'hi');
   ERROR 1146 (42S02): Table 'demo_ds_0.whereareyour' doesn't exist
   ```
   
   ### Reason analyze (If you can)
   ![image](https://user-images.githubusercontent.com/20503072/149612108-4e4d82d7-9c21-42bc-a23e-2f21b3f28eb1.png)
   
   DDL was routed to `ds_1` but the insert SQL was routed to `ds_0`.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ```yaml
   schemaName: sharding_db
   
   dataSources:
     ds_0:
       url: jdbc:mysql://127.0.0.1:3306/demo_ds_0
       username: root
       password: sudo reboot
       connectionTimeoutMilliseconds: 3000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 32
       minPoolSize: 0
     ds_1:
       url: jdbc:mysql://127.0.0.1:3306/demo_ds_1
       username: root
       password: sudo reboot
       connectionTimeoutMilliseconds: 3000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 32
       minPoolSize: 0
   ```
   
   


-- 
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] TeslaCN commented on issue #14796: ShardingSphere-Proxy empty rule with multiple DataSources cause some problems

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


   Thanks, it's my fault.


-- 
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] TeslaCN closed issue #14796: ShardingSphere-Proxy empty rule with multiple DataSources cause some problems

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #14796:
URL: https://github.com/apache/shardingsphere/issues/14796


   


-- 
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] strongduanmu commented on issue #14796: ShardingSphere-Proxy empty rule with multiple DataSources cause some problems

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


   @TeslaCN The problem was due to a typo, the table name in the statement was misspelled.


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