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

   https://github.com/zhangheng0027/testSharding.git
   
   When two databases have the same table, it is not as expected.
   
   ```
   dataSources:
     master:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: com.mysql.cj.jdbc.Driver
       jdbcUrl: 
jdbc:mysql://localhost:3406/test?serverTimezone=GMT%2B8&characterEncoding=utf8&useSSL=true
       username: zhang
       password: 123456
   
     aa:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: com.mysql.cj.jdbc.Driver
       jdbcUrl: 
jdbc:mysql://localhost:3406/test?serverTimezone=GMT%2B8&characterEncoding=utf8&useSSL=true
       username: zhang
       password: 123456
   
   
   props:
     sql-show: true
   
   
   rules:
     - !SINGLE
       tables:
         - master.equipment_oee
         - aa.equipment_status
       defaultDataSource: master
   ```
   
   ```
       @Test
       public void test02() throws Exception {
           try (Connection connection = dataSource.getConnection()) {
               connection.prepareStatement("select * from 
equipment_oee").execute();
               connection.prepareStatement("select * from 
equipment_status").execute();
           }
           // result
           // ShardingSphere-SQL                       : Logic SQL: select * 
from equipment_oee
           // ShardingSphere-SQL                       : Actual SQL: aa ::: 
select * from equipment_oee
           // ShardingSphere-SQL                       : Logic SQL: select * 
from equipment_status
           // ShardingSphere-SQL                       : Actual SQL: aa ::: 
select * from equipment_status
       }
   ```
   
   **The expected result should be master ::: select * from equipment_oee**


-- 
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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to