marktrue commented on issue #8525:
URL: https://github.com/apache/shardingsphere/issues/8525#issuecomment-742421804


   it seems happened only when query show tables;
   <pre>
   <code>
   [INFO ] 10:04:56.804 [ShardingSphere-Command-7] ShardingSphere-SQL - Logic 
SQL: select * from gk_user
   [INFO ] 10:04:56.804 [ShardingSphere-Command-7] ShardingSphere-SQL - 
SQLStatement: MySQLSelectStatement(limit=Optional.empty, lock=Optional.empty)
   [INFO ] 10:04:56.804 [ShardingSphere-Command-7] ShardingSphere-SQL - Actual 
SQL: replica_ds_0 ::: select * from gk_user
   [INFO ] 10:05:35.266 [ShardingSphere-Command-8] ShardingSphere-SQL - Logic 
SQL: show tables
   [INFO ] 10:05:35.267 [ShardingSphere-Command-8] ShardingSphere-SQL - 
SQLStatement: MySQLShowTablesStatement(fromSchema=Optional.empty)
   [INFO ] 10:05:35.267 [ShardingSphere-Command-8] ShardingSphere-SQL - Actual 
SQL: pr_ds ::: show tables
   [ERROR] 10:05:35.268 [ShardingSphere-Command-8] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.NullPointerException: Can not get connection from datasource pr_ds.
        at 
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:987)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.getConnections(JDBCBackendDataSource.java:80)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.getConnections(JDBCBackendDataSource.java:62)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection.getConnectionsWithoutTransaction(BackendConnection.java:141)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection.getConnections(BackendConnection.java:102)
        at 
org.apache.shardingsphere.infra.executor.sql.resourced.group.ResourceManagedExecuteGroupEngine.generateSQLExecuteGroups(ResourceManagedExecuteGroupEngine.java:66)
        at 
org.apache.shardingsphere.infra.executor.sql.group.AbstractExecuteGroupEngine.generate(AbstractExecuteGroupEngine.java:58)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.engine.jdbc.JDBCExecuteEngine.generateInputGroups(JDBCExecuteEngine.java:140)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.engine.jdbc.JDBCExecuteEngine.executeWithManagedResource(JDBCExecuteEngine.java:130)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.engine.jdbc.JDBCExecuteEngine.execute(JDBCExecuteEngine.java:123)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.engine.jdbc.JDBCExecuteEngine.execute(JDBCExecuteEngine.java:103)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.doExecute(JDBCDatabaseCommunicationEngine.java:93)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:79)
        at 
org.apache.shardingsphere.proxy.backend.text.admin.ShowTablesBackendHandler.execute(ShowTablesBackendHandler.java:65)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:62)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:100)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:76)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
   
   </code>
   </pre>


----------------------------------------------------------------
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:
[email protected]


Reply via email to