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/11/21 11:30:08 UTC

[GitHub] [incubator-shardingsphere] ssxlulu opened a new issue #3572: Design for MySQL information_schema query

ssxlulu opened a new issue #3572: Design for MySQL information_schema query
URL: https://github.com/apache/incubator-shardingsphere/issues/3572
 
 
   Query from information_schema is a common scene, some MySQL management client like Navicat will send such queries at the beginning of connection to ShardingSphere.
   
   But ShardingSphere doesn't support information_schema query well for now.
   
   For example, Navicat will send the following sql to SS:
   
   `SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'sharding_db' UNION SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA
    = 'sharding_db' UNION SELECT COUNT(*) FROM information_schema.ROUTINES WHERE ROU
   TINE_SCHEMA = 'sharding_db';`
   
   But this sql will cause NPE exception for SS:
   
   ```
   java.lang.NullPointerException: null
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.createConnection(JDBCBackendDataSource.java:150)
   	at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.datasource.JDBCBackendDataSource.getConnections(JDBCBackendDataSource.java:123)
   	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)
   ……
   ```
   
   What's more, Navicat will not only send one sql, above is just an example.
   
   

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