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/05/06 02:43:33 UTC

[GitHub] [shardingsphere] zjcnb opened a new issue, #17360: Get all tables name throws NPE when use PostgreSQL database

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

   ### Which version of ShardingSphere did you use?
   
   `master`
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   `ShardingSphere-Proxy`
   
   ### Expected behavior
   
   Not throws NPE
   
   ### Actual behavior
   
   ```
   [INFO ] 2022-05-06 10:31:44.057 [Connection-5-ThreadExecutor] o.a.s.p.b.t.a.e.AbstractDatabaseMetadataExecutor$DefaultDatabaseMetadataExecutor - Actual SQL: primary_ds ::: SELECT d.datname as "Name",
          pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
          pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
          d.datcollate as "Collate",
          d.datctype as "Ctype",
          pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges"
   FROM pg_catalog.pg_database d
   ORDER BY 1;
   [INFO ] 2022-05-06 10:32:13.505 [Connection-5-ThreadExecutor] o.a.s.p.b.t.a.e.AbstractDatabaseMetadataExecutor$DefaultDatabaseMetadataExecutor - Actual SQL: primary_ds ::: SELECT d.datname as "Name",
          pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
          pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
          d.datcollate as "Collate",
          d.datctype as "Ctype",
          pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges"
   FROM pg_catalog.pg_database d
   ORDER BY 1;
   [ERROR] 2022-05-06 10:32:45.763 [Connection-5-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.NullPointerException: null
   	at org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionEngine.getShorthandColumnsFromSimpleTableSegment(ProjectionEngine.java:157)
   	at org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionEngine.createProjection(ProjectionEngine.java:113)
   	at org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionEngine.createProjection(ProjectionEngine.java:78)
   	at org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionsContextEngine.getProjections(ProjectionsContextEngine.java:76)
   	at org.apache.shardingsphere.infra.binder.segment.select.projection.engine.ProjectionsContextEngine.createProjectionsContext(ProjectionsContextEngine.java:66)
   	at org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext.<init>(SelectStatementContext.java:115)
   	at org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.getDMLStatementContext(SQLStatementContextFactory.java:150)
   	at org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.newInstance(SQLStatementContextFactory.java:133)
   	at org.apache.shardingsphere.infra.binder.SQLStatementContextFactory.newInstance(SQLStatementContextFactory.java:118)
   	at org.apache.shardingsphere.proxy.backend.text.TextProtocolBackendHandlerFactory.newInstance(TextProtocolBackendHandlerFactory.java:99)
   	at org.apache.shardingsphere.proxy.frontend.postgresql.command.query.simple.PostgreSQLComQueryExecutor.<init>(PostgreSQLComQueryExecutor.java:70)
   	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:105)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:77)
   	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)
   
   ```
   
   ### SQL
   
   `readwrite_splitting_db=> select * from pg_tables where schemaname = 'readwrite_splitting_db';`
   
   The `readwrite_splitting_db` schema not have table.
   
   


-- 
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] strongduanmu commented on issue #17360: Get all tables name throws NPE when use PostgreSQL database

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #17360:
URL: https://github.com/apache/shardingsphere/issues/17360#issuecomment-1119213104

   @zjcnb Thank you for your feedback, I will investigate this issue.


-- 
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] strongduanmu closed issue #17360: Get all tables name throws NPE when use PostgreSQL database

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #17360: Get all tables name throws NPE when use PostgreSQL database
URL: https://github.com/apache/shardingsphere/issues/17360


-- 
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] strongduanmu commented on issue #17360: Get all tables name throws NPE when use PostgreSQL database

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #17360:
URL: https://github.com/apache/shardingsphere/issues/17360#issuecomment-1120105898

   Hi @zjcnb, this bug has been fixed in master branch.


-- 
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] strongduanmu closed issue #17360: Get all tables name throws NPE when use PostgreSQL database

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #17360: Get all tables name throws NPE when use PostgreSQL database
URL: https://github.com/apache/shardingsphere/issues/17360


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