linghengqian opened a new issue, #33860: URL: https://github.com/apache/shardingsphere/issues/33860
## 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? - https://github.com/apache/shardingsphere/commit/68207cb73026197733824042a3f19da743379a6d ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? ### Expected behavior - Unit tests work fine. ### Actual behavior - Since #33855 merge, unit tests for HiveServer2 and MS SQL Server fail. ### Reason analyze (If you can) - I don't know. I am curious why the error message uses Postgres related classes? ```shell [INFO] Running org.apache.shardingsphere.test.natived.jdbc.databases.SQLServerTest [ERROR] 2024-12-01 14:28:20.202 [main] com.zaxxer.hikari.pool.HikariPool - HikariPool-65 - Exception during pool initialization. java.lang.NullPointerException: Cannot invoke "org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema.getAllTables()" because "schema" is null at org.apache.shardingsphere.infra.metadata.statistics.builder.dialect.PostgreSQLShardingSphereStatisticsBuilder.initTables(PostgreSQLShardingSphereStatisticsBuilder.java:95) at org.apache.shardingsphere.infra.metadata.statistics.builder.dialect.PostgreSQLShardingSphereStatisticsBuilder.initSchemas(PostgreSQLShardingSphereStatisticsBuilder.java:79) at org.apache.shardingsphere.infra.metadata.statistics.builder.dialect.PostgreSQLShardingSphereStatisticsBuilder.build(PostgreSQLShardingSphereStatisticsBuilder.java:62) at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.initStatistics(MetaDataContextsFactory.java:182) at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.newMetaDataContexts(MetaDataContextsFactory.java:140) at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.createByLocal(MetaDataContextsFactory.java:115) at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:87) at org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder.build(StandaloneContextManagerBuilder.java:50) at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:74) at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.<init>(ShardingSphereDataSource.java:63) at org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:95) at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:136) at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:71) at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.createDataSource(DriverDataSourceCache.java:57) at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.lambda$get$0(DriverDataSourceCache.java:50) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1742) at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.get(DriverDataSourceCache.java:50) at org.apache.shardingsphere.driver.ShardingSphereDriver.connect(ShardingSphereDriver.java:57) at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81) at org.apache.shardingsphere.test.natived.jdbc.databases.SQLServerTest.assertShardingInLocalTransactions(SQLServerTest.java:46) [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 18.98 s <<< FAILURE! -- in org.apache.shardingsphere.test.natived.jdbc.databases.SQLServerTest [ERROR] org.apache.shardingsphere.test.natived.jdbc.databases.SQLServerTest.assertShardingInLocalTransactions -- Time elapsed: 16.59 s <<< ERROR! com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Cannot invoke "org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema.getAllTables()" because "schema" is null at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596) at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:582) at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81) at org.apache.shardingsphere.test.natived.jdbc.databases.SQLServerTest.assertShardingInLocalTransactions(SQLServerTest.java:46) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at java.base/java.util.ArrayList.forEach(ArrayList.java:1597) at java.base/java.util.ArrayList.forEach(ArrayList.java:1597) Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema.getAllTables()" because "schema" is null at org.apache.shardingsphere.infra.metadata.statistics.builder.dialect.PostgreSQLShardingSphereStatisticsBuilder.initTables(PostgreSQLShardingSphereStatisticsBuilder.java:95) at org.apache.shardingsphere.infra.metadata.statistics.builder.dialect.PostgreSQLShardingSphereStatisticsBuilder.initSchemas(PostgreSQLShardingSphereStatisticsBuilder.java:79) at org.apache.shardingsphere.infra.metadata.statistics.builder.dialect.PostgreSQLShardingSphereStatisticsBuilder.build(PostgreSQLShardingSphereStatisticsBuilder.java:62) at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.initStatistics(MetaDataContextsFactory.java:182) at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.newMetaDataContexts(MetaDataContextsFactory.java:140) at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.createByLocal(MetaDataContextsFactory.java:115) at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:87) at org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder.build(StandaloneContextManagerBuilder.java:50) at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:74) at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.<init>(ShardingSphereDataSource.java:63) at org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:95) at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:136) at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:71) at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.createDataSource(DriverDataSourceCache.java:57) at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.lambda$get$0(DriverDataSourceCache.java:50) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1742) at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.get(DriverDataSourceCache.java:50) at org.apache.shardingsphere.driver.ShardingSphereDriver.connect(ShardingSphereDriver.java:57) at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ... 6 more ``` ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. ```shell sdk install java 22.0.2-graalce git clone [email protected]:apache/shardingsphere.git cd ./shardingsphere/ git reset --hard 68207cb73026197733824042a3f19da743379a6d sdk use java 22.0.2-graalce ./mvnw -PgenerateMetadata -DskipNativeTests -e -T 1C clean test ``` - The log is as follows, ```shell [INFO] Results: [INFO] [ERROR] Errors: [ERROR] SQLServerTest.assertShardingInLocalTransactions:46 » PoolInitialization Failed to initialize pool: Cannot invoke "org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema.getAllTables()" because "schema" is null [ERROR] AcidTableTest.assertShardingInLocalTransactions:80->createDataSource:108 » PoolInitialization Failed to initialize pool: Cannot invoke "org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema.getAllTables()" because "schema" is null [ERROR] IcebergTest.assertShardingInLocalTransactions:80->createDataSource:108 » PoolInitialization Failed to initialize pool: Cannot invoke "org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema.getAllTables()" because "schema" is null [ERROR] StandaloneMetastoreTest.assertShardingInLocalTransactions:92->createDataSource:120 » PoolInitialization Failed to initialize pool: Cannot invoke "org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema.getAllTables()" because "schema" is null [ERROR] ZookeeperServiceDiscoveryTest.assertShardingInLocalTransactions:116->createDataSource:150 » PoolInitialization Failed to initialize pool: Cannot invoke "org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema.getAllTables()" because "schema" is null [INFO] [ERROR] Tests run: 21, Failures: 0, Errors: 5, Skipped: 0 [INFO] ``` ### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
