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 2021/11/17 08:07:38 UTC

[GitHub] [shardingsphere] ningpp opened a new issue #13659: DatabaseTypeRecognizer.getDatabaseType(final DataSource dataSource) return null when SQLException happen

ningpp opened a new issue #13659:
URL: https://github.com/apache/shardingsphere/issues/13659


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.0.0,  master
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ### Expected behavior
    throw new IllegalStateException ...
   
   ### Actual behavior
   return 
   
   ### Reason analyze (If you can)
   when i write a wrong jdbc url ( mistake ),  the error log is not good .
   log like this 
   
   Caused by: java.lang.IllegalStateException: Database type inconsistent with 'org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType@1da53f4f' and 'null'
   	at com.google.common.base.Preconditions.checkState(Preconditions.java:826) ~[guava-30.1.1-jre.jar:?]
   	at org.apache.shardingsphere.infra.database.type.DatabaseTypeRecognizer.getDatabaseType(DatabaseTypeRecognizer.java:45) ~[shardingsphere-infra-common-5.0.0.jar:5.0.0]
   	at org.apache.shardingsphere.infra.rule.builder.schema.SchemaRulesBuilder.buildRules(SchemaRulesBuilder.java:69) ~[shardingsphere-infra-common-5.0.0.jar:5.0.0]
   	at org.apache.shardingsphere.mode.manager.memory.MemoryContextManagerBuilder.build(MemoryContextManagerBuilder.java:53) ~[shardingsphere-memory-mode-core-5.0.0.jar:5.0.0]
   	at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:75) ~[shardingsphere-jdbc-core-5.0.0.jar:5.0.0]
   	at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.<init>(ShardingSphereDataSource.java:61) ~[shardingsphere-jdbc-core-5.0.0.jar:5.0.0]
   	at org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:79) ~[shardingsphere-jdbc-core-5.0.0.jar:5.0.0]
   	
   
   ### 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

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



[GitHub] [shardingsphere] menghaoranss commented on issue #13659: DatabaseTypeRecognizer.getDatabaseType(final DataSource dataSource) return null when SQLException happen

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


   @ningpp do you have any suggestions?


-- 
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] terrymanu closed issue #13659: DatabaseTypeRecognizer.getDatabaseType(final DataSource dataSource) return null when SQLException happen

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


   


-- 
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] ningpp commented on issue #13659: DatabaseTypeRecognizer.getDatabaseType(final DataSource dataSource) return null when SQLException happen

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


   what about throw new IllegalStateException ?


-- 
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] ningpp commented on issue #13659: DatabaseTypeRecognizer.getDatabaseType(final DataSource dataSource) return null when SQLException happen

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


   OK


-- 
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] terrymanu commented on issue #13659: DatabaseTypeRecognizer.getDatabaseType(final DataSource dataSource) return null when SQLException happen

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


   @ningpp Yes, it is better to throw IllegalArgumentException than return null.
   Could you try to submit a pull request?


-- 
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] ningpp commented on issue #13659: DatabaseTypeRecognizer.getDatabaseType(final DataSource dataSource) return null when SQLException happen

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


   hello?


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