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 2020/05/08 08:31:49 UTC
[GitHub] [shardingsphere] DreamerBear opened a new issue #5467: NPE when select * from table
DreamerBear opened a new issue #5467:
URL: https://github.com/apache/shardingsphere/issues/5467
### Which version of ShardingSphere did you use?
4.0.0
### Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC
### Expected behavior
return expected metaData and resultSet
### Actual behavior
org.apache.shardingsphere.core.exception.ShardingException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at org.apache.shardingsphere.core.execute.engine.ShardingExecuteEngine.throwException(ShardingExecuteEngine.java:144)
at org.apache.shardingsphere.core.execute.engine.ShardingExecuteEngine.getGroupResults(ShardingExecuteEngine.java:134)
at org.apache.shardingsphere.core.execute.engine.ShardingExecuteEngine.parallelExecute(ShardingExecuteEngine.java:102)
at org.apache.shardingsphere.core.execute.engine.ShardingExecuteEngine.groupExecute(ShardingExecuteEngine.java:83)
at org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteTemplate.executeGroup(SQLExecuteTemplate.java:73)
at org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteTemplate.executeGroup(SQLExecuteTemplate.java:56)
at org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor.executeCallback(AbstractStatementExecutor.java:140)
at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.executeQuery(PreparedStatementExecutor.java:109)
at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.executeQuery(ShardingPreparedStatement.java:123)
### Reason analyze (If you can)
execute select * from table
when user define a unsigned bigint default null column in a table and set null to this column in a row
the stack trace is
java.lang.NullPointerException
at org.apache.shardingsphere.core.execute.sql.execute.result.MemoryQueryResult.getRowValue(MemoryQueryResult.java:88)
at org.apache.shardingsphere.core.execute.sql.execute.result.MemoryQueryResult.getRows(MemoryQueryResult.java:63)
at org.apache.shardingsphere.core.execute.sql.execute.result.MemoryQueryResult.<init>(MemoryQueryResult.java:55)
at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.getQueryResult(PreparedStatementExecutor.java:116)
at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.access$200(PreparedStatementExecutor.java:50)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
the source code `resultSet.getBigDecimal(columnIndex).toBigInteger();` may cause NPE
### Example codes for reproduce this issue (such as a github link).
----------------------------------------------------------------
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