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 2019/10/24 12:15:13 UTC

[GitHub] [incubator-shardingsphere] jiang2015 opened a new issue #3362: default configuration such as [defaultDataSourceName] set default value is better?

jiang2015 opened a new issue #3362: default configuration such as [defaultDataSourceName] set default value is better?
URL: https://github.com/apache/incubator-shardingsphere/issues/3362
 
 
   ## Feature Request
   ### Is your feature request related to a problem?
   yes, 
   version of ShardingSphere: **4.0.0-RC3-SNAPSHOT**
   project: Sharding-Proxy
   The problem:
    when I use navicat connect Sharding-Proxy, Executing a SQL:
   [SELECT QUERY_ID, SUM(DURATION) AS SUM_DURATION FROM INFORMATION_SCHEMA.PROFILING GROUP BY QUERY_ID;]the sql result throw Exception:
   
   [INFO ] 19:59:49.313 [ShardingSphere-Command-5] o.a.s.s.f.m.c.MySQLCommandExecutorFactory - Execute packet type: COM_QUERY, value: MySQLComQueryPacket(sql=SELECT QUERY_ID, SUM(DURATION) AS SUM_DURATION FROM INFORMATION_SCHEMA.PROFILING GROUP BY QUERY_ID;)
   [ERROR] 19:59:49.898 [ShardingSphere-Command-5] o.a.s.s.f.c.CommandExecutorTask - Exception occur: 
   java.lang.NullPointerException: null
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.createConnection(JDBCBackendDataSource.java:153)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.getConnections(JDBCBackendDataSource.java:126)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.connection.BackendConnection.getConnectionFromUnderlying(BackendConnection.java:198)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.connection.BackendConnection.getConnectionsWithoutTransaction(BackendConnection.java:181)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.connection.BackendConnection.getConnections(BackendConnection.java:150)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.execute.callback.ProxyJDBCExecutePrepareCallback.getConnections(ProxyJDBCExecutePrepareCallback.java:56)
   	at org.apache.shardingsphere.core.execute.sql.prepare.SQLExecutePrepareTemplate.getSQLExecuteGroups(SQLExecutePrepareTemplate.java:89)
   	at org.apache.shardingsphere.core.execute.sql.prepare.SQLExecutePrepareTemplate.getSynchronizedExecuteUnitGroups(SQLExecutePrepareTemplate.java:67)
   	at org.apache.shardingsphere.core.execute.sql.prepare.SQLExecutePrepareTemplate.getExecuteUnitGroups(SQLExecutePrepareTemplate.java:59)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.execute.JDBCExecuteEngine.execute(JDBCExecuteEngine.java:80)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:93)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:78)
   	at org.apache.shardingsphere.shardingproxy.backend.text.query.QueryBackendHandler.execute(QueryBackendHandler.java:54)
   	at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:72)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:87)
   	at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:67)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   
   I debug the source,find the reason: the file:[config-sharding.yaml] the part :[shardingRule] not configured [defaultDataSourceName] ,because the table [PROFILING] not configured in [shardingRule],so when the table [PROFILING] sharding it used defaultDataSource.
   
   ### Describe the feature you would like.
   I see the source,find that the class[ShardingRuleConfiguration] has some default configuration,like [defaultDataSourceName],[defaultDatabaseShardingStrategyConfig] and so on,I think when the Sharding-Proxy start,like default configuration such as [defaultDataSourceName] set default value is better?

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


With regards,
Apache Git Services