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/12/07 20:16:21 UTC

[GitHub] [shardingsphere] linghengqian opened a new issue, #22737: `StandardJdbcUrlParser#parse` does not support specifying TestContainer-specific Image Tags

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

   ## 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.2.1
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   - ShardingSphere-JDBC
   
   ### Expected behavior
   
   - `StandardJdbcUrlParser#parse` support specifying TestContainer-specific Image Tags.
   
   ### Actual behavior
   
   - `StandardJdbcUrlParser#parse` does not support specifying TestContainer-specific Image Tags.
   ```shell
   2022-12-08 04:04:18.536 ERROR 87669 --- [    Test worker] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.
   
   org.apache.shardingsphere.infra.database.metadata.UnrecognizedDatabaseURLException: null
   	at org.apache.shardingsphere.infra.database.metadata.url.StandardJdbcUrlParser.parse(StandardJdbcUrlParser.java:63) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.database.metadata.dialect.MySQLDataSourceMetaData.<init>(MySQLDataSourceMetaData.java:48) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType.getDataSourceMetaData(MySQLDatabaseType.java:57) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType.getDataSourceMetaData(MySQLDatabaseType.java:33) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData.createDataSourceMetaDataMap(ShardingSphereResourceMetaData.java:64) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResourceMetaData.<init>(ShardingSphereResourceMetaData.java:53) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase.createResourceMetaData(ShardingSphereDatabase.java:116) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase.create(ShardingSphereDatabase.java:110) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase.create(ShardingSphereDatabase.java:93) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabasesFactory.createGenericDatabases(ShardingSphereDatabasesFactory.java:81) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabasesFactory.create(ShardingSphereDatabasesFactory.java:69) ~[shardingsphere-infra-common-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:91) ~[shardingsphere-mode-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:69) ~[shardingsphere-mode-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder.build(StandaloneContextManagerBuilder.java:49) ~[shardingsphere-standalone-mode-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:76) ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.<init>(ShardingSphereDataSource.java:64) ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:93) ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:133) ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:75) ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.createDataSource(DriverDataSourceCache.java:51) ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
   	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
   	at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.get(DriverDataSourceCache.java:45) ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
   	at org.apache.shardingsphere.driver.ShardingSphereDriver.connect(ShardingSphereDriver.java:51) ~[shardingsphere-jdbc-core-5.2.1.jar:5.2.1]
   	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) ~[HikariCP-4.0.3.jar:na]
   	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
   	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
   	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
   	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
   	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
   	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
   	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159) ~[spring-jdbc-5.3.24.jar:5.3.24]
   	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117) ~[spring-jdbc-5.3.24.jar:5.3.24]
   	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[spring-jdbc-5.3.24.jar:5.3.24]
   	at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80) ~[mybatis-spring-2.1.0.jar:2.1.0]
   	at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) ~[mybatis-spring-2.1.0.jar:2.1.0]
   	at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:337) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:86) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.11.jar:3.5.11]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
   	at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425) ~[mybatis-spring-2.1.0.jar:2.1.0]
   	at jdk.proxy3/jdk.proxy3.$Proxy72.selectList(Unknown Source) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-2.1.0.jar:2.1.0]
   	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145) ~[mybatis-3.5.11.jar:3.5.11]
   	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86) ~[mybatis-3.5.11.jar:3.5.11]
   ```
   
   ### Reason analyze (If you can)
   
   - Not sure how to modify this method.
   - Once the `jdbcUrl` of the `resources/sharding-table.yml` file is changed from `jdbc:tc:mysql:5.7.34:///integration-tests-db?TC_INITSCRIPT=db/schema.sql&TC_DAEMON=true` to ` jdbc:tc:mysql:///integration-tests-db?TC_INITSCRIPT=db/schema.sql&TC_DAEMON=true`, everything will be fine.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   - Perform the following steps.
   ```shell
   git clone git@github.com:linghengqian/shardingsphere-testcontainer-test.git
   cd ./shardingsphere-testcontainer-test/
   sdk install java 22.3.r17-grl
   sdk use java 22.3.r17-grl
   ./gradlew clean test
   ```
   - ![image](https://user-images.githubusercontent.com/20187731/206285422-c4cfe931-9c20-4044-bf40-05724085024c.png)
   
   
   ### Example codes for reproduce this issue (such as a github link).
   
   - Git at https://github.com/linghengqian/shardingsphere-testcontainer-test .
   - This issue is somewhat related to https://github.com/apache/shardingsphere/issues/21453 .


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

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


[GitHub] [shardingsphere] linghengqian commented on issue #22737: `StandardJdbcUrlParser#parse` does not support specifying TestContainer-specific Image Tags

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

   - I am working on this issue.


-- 
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] sandynz commented on issue #22737: `StandardJdbcUrlParser#parse` does not support specifying TestContainer-specific Image Tags

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

   > * I am working on this issue.
   
   Nice. Assigned to you


-- 
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] sandynz closed issue #22737: `StandardJdbcUrlParser#parse` does not support specifying TestContainer-specific Image Tags

Posted by GitBox <gi...@apache.org>.
sandynz closed issue #22737: `StandardJdbcUrlParser#parse` does not support specifying TestContainer-specific Image Tags
URL: https://github.com/apache/shardingsphere/issues/22737


-- 
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] sandynz commented on issue #22737: `StandardJdbcUrlParser#parse` does not support specifying TestContainer-specific Image Tags

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

   Hi @linghengqian , thanks for your feedback.
   
   I checked `jdbcUrl: jdbc:tc:mysql:5.7.34:///integration-tests-db?TC_INITSCRIPT=db/schema.sql&TC_DAEMON=true`, looks `StandardJdbcUrlParser`'s `SCHEMA_PATTERN` could be upated to support more flexible schema.
   


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