sandynz commented on issue #12672:
URL: 
https://github.com/apache/shardingsphere/issues/12672#issuecomment-926480024


   Verification:
   ```
   mysql> create database logic_db;
   Query OK, 0 rows affected (0.01 sec)
   
   mysql> show databases;
   +-------------+
   | schema_name |
   +-------------+
   | sharding_db |
   | shard1      |
   | logic_db    |
   +-------------+
   3 rows in set (0.00 sec)
   ```
   
   `logic_db` has empty `dataSources` and `rules`.
   
   Set breakpoint on `FrontDatabaseProtocolTypeFactory.getDatabaseType()`, 
start proxy, 
`ProxyContext.getInstance().getContextManager().getMetaDataContexts().getAllSchemaNames()`
 return `0 = "logic_db"
   1 = "sharding_db"
   2 = "shard1"`.
   
   `.iterator().next()` will return `logic_db`. Since `dataSources` is empty, 
then default database MySQL will be used.
   If current testing database type is not MySQL, then connect to proxy will be 
failed.
   
   Since `getAllSchemaNames()` return `HashMap`, the first element depends on 
contents.
   


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