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/01/06 13:25:10 UTC

[GitHub] [incubator-shardingsphere] terrymanu commented on a change in pull request #3879: fix proxy hang up while throwing a customize SQLException

terrymanu commented on a change in pull request #3879: fix proxy hang up while throwing a customize SQLException
URL: https://github.com/apache/incubator-shardingsphere/pull/3879#discussion_r363290975
 
 

 ##########
 File path: sharding-proxy/sharding-proxy-frontend/sharding-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/frontend/mysql/MySQLErrPacketFactory.java
 ##########
 @@ -48,7 +48,7 @@
     public static MySQLErrPacket newInstance(final int sequenceId, final Exception cause) {
         if (cause instanceof SQLException) {
             SQLException sqlException = (SQLException) cause;
-            return new MySQLErrPacket(sequenceId, sqlException.getErrorCode(), sqlException.getSQLState(), sqlException.getMessage());
+            return new MySQLErrPacket(sequenceId, sqlException.getErrorCode(), null != sqlException.getSQLState() ? sqlException.getSQLState() : "", sqlException.getMessage());
 
 Review comment:
   Please use a SQL State instead of empty string if we can find a suitable one.

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


With regards,
Apache Git Services