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

   ### Which version of ShardingSphere did you use?
   master 1b50bb6cc1c9a1dd537f65a271363aa4f2cdd81d
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   When schema does not exist and user executes a query, give an appropriate 
error message
   
   ### Actual behavior
   ```sql
   postgres=> select * from t_order;
   ERROR:  Cannot invoke 
"org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema.getAllColumnNames(String)"
 because the return value of "java.util.Map.get(Object)" is null
   ```
   
   #### Log
   ```
   java.lang.NullPointerException: Cannot invoke 
"org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema.getAllColumnNames(String)"
 because the return value of "java.util.Map.get(Object)" is null
        at 
org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionEngine.getShorthandColumnsFromSimpleTableSegment(ProjectionEngine.java:163)
        at 
org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionEngine.createProjection(ProjectionEngine.java:117)
        at 
org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionEngine.createProjection(ProjectionEngine.java:82)
        at 
org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionsContextEngine.getProjections(ProjectionsContextEngine.java:77)
        at 
org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionsContextEngine.createProjectionsContext(ProjectionsContextEngine.java:67)
        at 
org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext.<init>(SelectStatementContext.java:116)
        at 
org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.getDMLStatementContext(SQLStatementContextFactory.java:160)
        at 
org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.newInstance(SQLStatementContextFactory.java:143)
        at 
org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.newInstance(SQLStatementContextFactory.java:128)
        at 
org.apache.shardingsphere.proxy.backend.handler.ProxyBackendHandlerFactory.newInstance(ProxyBackendHandlerFactory.java:114)
        at 
org.apache.shardingsphere.proxy.backend.handler.ProxyBackendHandlerFactory.newInstance(ProxyBackendHandlerFactory.java:88)
        at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.simple.PostgreSQLComQueryExecutor.<init>(PostgreSQLComQueryExecutor.java:72)
        at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecutorFactory.getCommandExecutor(PostgreSQLCommandExecutorFactory.java:106)
        at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecutorFactory.newInstance(PostgreSQLCommandExecutorFactory.java:71)
        at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.PostgreSQLCommandExecuteEngine.getCommandExecutor(PostgreSQLCommandExecuteEngine.java:66)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:110)
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   #### Props in server.yaml
   ```yaml
   props:
     proxy-frontend-database-protocol-type: PostgreSQL
   ```
   Start the Proxy with PostgreSQL type, connect to the logic database 
`postgres`, and execute query SQL.
   


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

Reply via email to