JiekerTime commented on code in PR #18859:
URL: https://github.com/apache/shardingsphere/pull/18859#discussion_r914628726


##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/MySQLSetCharsetExecutor.java:
##########
@@ -60,7 +61,13 @@ private Charset parseCharset(final String value) {
             case "utf8mb4":
                 return StandardCharsets.UTF_8;
             default:
-                return Charset.forName(value);
+                try {
+                    return Charset.forName(value);
+                    // CHECKSTYLE:OFF
+                } catch (Exception ex) {

Review Comment:
   > > Perhaps you could try executing the statement set name '"utf8"';
   > > It may cause Charset.forName(""utf8"");
   > 
   > I don't think MySQL will accept `set name '"utf8"'`, we just need to 
handle the `set name "utf8"` in this PR.
   
   I think if we don't handle this exception it could lead to a decrease in 
user-friendliness like the following.
   
   
![image](https://user-images.githubusercontent.com/76552510/177519139-0855500a-5997-4b4e-a802-bdbb9947f900.png)
   
   I can remove this try-catch if this is not a good change.
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to