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 2020/10/28 10:02:44 UTC

[GitHub] [shardingsphere] taojintianxia commented on issue #7761: Add test case for MetaDataConnectionAdapter.getSchema with SPI

taojintianxia commented on issue #7761:
URL: https://github.com/apache/shardingsphere/issues/7761#issuecomment-717827563


   @jiang2015 hi there
   
   after check the source code of `OracleDatabaseMetaDataDialectHandler` we could find out that the handler implementation for Oracle is different than MySQL like followings : 
   
   ```java
   
       @Override
       public String getSchema(final Connection connection) {
           try {
               return Optional.ofNullable(connection.getMetaData().getUserName()).map(String::toUpperCase).orElse(null);
           } catch (final SQLException ignored) {
               return null;
           }
       }
   ``` 
   
   in your test case, you just mock the getSchema, but the schema for Oracle is from userName in metadata. ^_^


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org