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 2022/10/10 06:33:41 UTC

[GitHub] [shardingsphere] RaigorJiang opened a new issue, #19814: [PostgreSQL] NPE occurs when schema does not exist in logic database

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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #19814: [PostgreSQL] NPE occurs when schema does not exist in logic database

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #19814:
URL: https://github.com/apache/shardingsphere/issues/19814#issuecomment-1272349109

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #19814: [PostgreSQL] NPE occurs when schema does not exist in logic database

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #19814: [PostgreSQL] NPE occurs when schema does not exist in logic database
URL: https://github.com/apache/shardingsphere/issues/19814


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] yx9o closed issue #19814: [PostgreSQL] NPE occurs when schema does not exist in logic database

Posted by GitBox <gi...@apache.org>.
yx9o closed issue #19814: [PostgreSQL] NPE occurs when schema does not exist in logic database
URL: https://github.com/apache/shardingsphere/issues/19814


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org