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/02/24 07:27:22 UTC

[GitHub] [shardingsphere] soulasuna commented on a change in pull request #15603: Set charset simple query supported in proxy

soulasuna commented on a change in pull request #15603:
URL: https://github.com/apache/shardingsphere/pull/15603#discussion_r813610123



##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutor.java
##########
@@ -71,10 +80,19 @@ public MySQLComQueryPacketExecutor(final MySQLComQueryPacket packet, final Conne
     }
     
     private Collection<DatabasePacket<?>> processUpdate(final UpdateResponseHeader updateResponseHeader) {
-        responseType = ResponseType.UPDATE;
         return ResponsePacketBuilder.buildUpdateResponsePackets(updateResponseHeader);
     }
     
+    private Collection<DatabasePacket<?>> processClientEncoding(final ClientEncodingResponseHeader clientEncodingResponseHeader) {
+        String value = clientEncodingResponseHeader.getValue();
+        Optional<Charset> charset = MySQLCharacterSet.findByValue(value);
+        if (charset.isPresent()) {
+            clientEncodingResponseHeader.getConnectionSession().getAttributeMap().attr(CommonConstants.CHARSET_ATTRIBUTE_KEY).set(charset.get());

Review comment:
       When using MySQL set character encoding not just for interacting with the client-side protocol. 
   The storage of data will also changed.
   I did test. The performance of proxy is consistent with MySQL.




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