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 05:48:36 UTC
[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #15603: Set charset simple query supported in proxy
TeslaCN commented on a change in pull request #15603:
URL: https://github.com/apache/shardingsphere/pull/15603#discussion_r813564368
##########
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:
There is another value `MySQLConstants.MYSQL_CHARACTER_SET_ATTRIBUTE_KEY` which represented MySQL charset and collation is stored in channel attributes map. What if the charset changed to `GBK` while the collation are still `utf8mb4`? The wrong collation id may be returned to client.
--
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