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 2021/04/16 07:44:00 UTC

[GitHub] [shardingsphere] xiaojingkai opened a new issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

xiaojingkai opened a new issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107


   
   
   
   ### Which version of ShardingSphere did you use?
   
   shardingsphere-5.0.0-alpha
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   insert emoji through utf8mb4
   
   ### Actual behavior
   
   Unable to insert Emoji ,and the value of character_set is transformed between utf8 and utf8mb4 when I connect to the proxy to execute the "SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';" sql,but , the value of character_set  is always utf8mb4 when I connect to master DB or slave DB 
   
   ### Reason analyze (If you can)
   
   I think,  sometimes the value of character_set will become utf8 instead of utf8mb4, so Emoji cannot be inserted
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   1、config config-master_slave.yaml & server.yaml
   2、mysql drive is  mysql-connector-java-5.1.49.jar
   3、connect sharding-proxy:  can not insert emoji
   4、connect real mysql:  can insert emoji
   
   ### Example codes for reproduce this issue (such as a github link).
   INSERT INTO spider_xhs_note (
           fd_id,
           fd_desc,
           id
           )
   VALUES
           (
                   '6072e0d800000000210369d4',
                   '我个人是追崇轻松感氛围穿搭的,错误穿搭对我而言更多的是不够松,我在现实里,这几年真的重来没有这样穿过😂@小红书视频号   @穿搭薯',
                   '178d554a96d8ae6b8ba0e814206a1f2b'
           )


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



[GitHub] [shardingsphere] xiaojingkai commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
xiaojingkai commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-821039594


   > Hi, I did not see any parameter of character set in JDBC url?
   > You can configure characterSet by the parameters of hikariCP.
   
   This is my previous configuration,but it didn't work: 
   url: jdbc:mysql://192.168.1.1:3306/dc_xhs?characterEncoding=utf8&serverTimezone=UTC&useSSL=false


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



[GitHub] [shardingsphere] xiaojingkai commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
xiaojingkai commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-822247775


   When I use Navicat to connect sharding proxy, the value of character queried by SQL will change between utf8 and utf8mb4


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



[GitHub] [shardingsphere] tristaZero commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-824501671


   Hi @xiaojingkai 
   Sorry for my late reply.  Could you give it a try with the following steps?
   First, please use `characterEncoding=utf8` for proxy configuration.
   Second, try to connect Proxy server with `characterEncoding=utf8`  by the mean of JDBC or CLI. (I am unsure whether Navicat will set character set as default, so let eliminate it.)


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



[GitHub] [shardingsphere] xiaojingkai commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
xiaojingkai commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-820991782


   I tried to change the version of sharding-proxy and MySQL database connection driver, but it didn't work


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



[GitHub] [shardingsphere] RaigorJiang closed issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107


   


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



[GitHub] [shardingsphere] RaigorJiang commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-928860966


   It has been communicated and verified, it is an environmental issue, not a bug.


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



[GitHub] [shardingsphere] tristaZero commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-886035083


   @cowcomic Hi, thanks for your feedback.


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



[GitHub] [shardingsphere] cowcomic commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
cowcomic commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-884642164


   we meet same problem, and now it not append again
   but we don`t know why
   
   we used two steps:
   1. not all tables`s charset is utf8mb4. some for them are utf8. we changed all of them to utf8mb4
   2. not all server linked shradingsphere use utf8mb4 in their connection url by character_set_server=utf8mb4&connectionCollation=utf8mb4_bin, we changed all of the connection url with character_set_server=utf8mb4&connectionCollation=utf8mb4_bin


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



[GitHub] [shardingsphere] tristaZero commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-821032492


   Hi, I did not see any parameter of character set in JDBC url?
   You can configure characterSet by the parameters of hikariCP.


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



[GitHub] [shardingsphere] RaigorJiang closed issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107


   


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



[GitHub] [shardingsphere] xiaojingkai commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
xiaojingkai commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-820989725


   /root/proxy5/conf/config-master_slave.yaml:
   
   dataSources:
     primary_ds:
       url: jdbc:mysql://192.168.1.1:3306/dc_xhs?serverTimezone=UTC&useSSL=false
     replica_ds_0:
       url: jdbc:mysql://192.168.1.2:3306/dc_xhs?serverTimezone=UTC&useSSL=false
   rules:
   - !REPLICA_QUERY
     dataSources:
       primary_ds:
         primaryDataSourceName: primary_ds
         replicaDataSourceNames: 
           - replica_ds_0


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



[GitHub] [shardingsphere] RaigorJiang commented on issue #10107: (sharding-proxy)The value of character_set is transformed between utf8 and utf8mb4

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10107:
URL: https://github.com/apache/shardingsphere/issues/10107#issuecomment-928860966


   It has been communicated and verified, it is an environmental issue, not a bug.


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