cmonkey commented on a change in pull request #6584:
URL: https://github.com/apache/shardingsphere/pull/6584#discussion_r464833792
##########
File path:
shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLErrPacketFactory.java
##########
@@ -47,7 +47,7 @@ public static MySQLErrPacket newInstance(final int
sequenceId, final Exception c
if (cause instanceof SQLException) {
SQLException sqlException = (SQLException) cause;
return null != sqlException.getSQLState() ? new
MySQLErrPacket(sequenceId, sqlException.getErrorCode(),
sqlException.getSQLState(), sqlException.getMessage())
- : new MySQLErrPacket(sequenceId,
MySQLServerErrorCode.ER_INTERNAL_ERROR, sqlException.getCause().getMessage());
+ : new MySQLErrPacket(sequenceId,
MySQLServerErrorCode.ER_INTERNAL_ERROR, cause.getMessage());
Review comment:
val exception = new SQLException()
MySQLErrPacketFactory.newInstance(1, exception)
cause.isInstanceOf[SQLException) is true
cause.asInstanceOF[SQLException) to sqlException
sqlException.SQLState is null
sqlException.cuase is not null
sqlException.getCuase is null
MySQLErrPacketFactory.newInstance throw NPE, write errorPacket failed,
Connection is hung
----------------------------------------------------------------
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:
[email protected]