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/10/19 09:30:53 UTC

[GitHub] [shardingsphere] xuxinstyle opened a new issue #7847: Garbled characters when inserting Chinese data

xuxinstyle opened a new issue #7847:
URL: https://github.com/apache/shardingsphere/issues/7847


   ## Question
   
   Garbled characters when inserting Chinese data
    version:
   sharding proxy 4.1.1
   sql: update `profile` set name="艾丹克莱尔UtWn" where id = 40586220;
   SELECT name from `profile` where id = 40586220; 
   
   result:
   ![image](https://user-images.githubusercontent.com/29884085/96427147-c6ebbb80-1230-11eb-967a-8f4476238074.png)
   


----------------------------------------------------------------
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] xuxinstyle commented on issue #7847: Garbled characters when inserting Chinese data

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


   > @xuxinstyle Can you set `sql.show=ture`,and then show the actual sql?
   Logic SQL: update `profile` set name="艾丹克莱尔UtWn" where id = 40586220;
   [INFO ] 18:41:34.715 [ShardingSphere-Command-13] ShardingSphere-SQL - SQLStatement: UpdateStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.UpdateStatement@64132658, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@3030dae6), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@3030dae6)
   [INFO ] 18:41:34.715 [ShardingSphere-Command-13] ShardingSphere-SQL - Actual SQL: ds_1 ::: update `profile` set name="艾丹克莱尔UtWn" where id = 40586220;
   [INFO ] 18:41:34.727 [ShardingSphere-Command-6] ShardingSphere-SQL - Logic SQL: SHOW STATUS
   


----------------------------------------------------------------
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] xuxinstyle commented on issue #7847: Garbled characters when inserting Chinese data

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


   I found the reason, just add &characterEncoding=utf-8 after the url


----------------------------------------------------------------
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] jingshanglu commented on issue #7847: Garbled characters when inserting Chinese data

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


   @xuxinstyle I test it on master, the statement generated by the parser is correct, maybe a problem with the character set settings.
   


----------------------------------------------------------------
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 #7847: Garbled characters when inserting Chinese data

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


   Hi @jingshanglu Could you check this issue with our parser engine? Let us figure out whether it is caused by parsing


----------------------------------------------------------------
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] xuxinstyle commented on issue #7847: Garbled characters when inserting Chinese data

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


   > > @xuxinstyle Can you set `sql.show=ture`,and then show the actual sql?
   > > Logic SQL: update `profile` set name="艾丹克莱尔UtWn" where id = 40586220;
   > > [INFO ] 18:41:34.715 [ShardingSphere-Command-13] ShardingSphere-SQL - SQLStatement: UpdateStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.UpdateStatement@64132658, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@3030dae6), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@3030dae6)
   > > [INFO ] 18:41:34.715 [ShardingSphere-Command-13] ShardingSphere-SQL - Actual SQL: ds_1 ::: update `profile` set name="艾丹克莱尔UtWn" where id = 40586220;
   > > [INFO ] 18:41:34.727 [ShardingSphere-Command-6] ShardingSphere-SQL - Logic SQL: SHOW STATUS
   
   
   server.yaml config:
   
   authentication:
     users:
       root:
         password: 123456
         authorizedSchemas: sharding_db
       sharding:
         password: 123456
         authorizedSchemas: sharding_db
   
   props:
     max.connections.size.per.query: 1
     acceptor.size: 16  # The default value is available processors count * 2.
     executor.size: 16  # Infinite by default.
     proxy.frontend.flush.threshold: 128  # The default value is 128.
       # LOCAL: Proxy will run with LOCAL transaction.
     # XA: Proxy will run with XA transaction.
     # BASE: Proxy will run with B.A.S.E transaction.
     proxy.transaction.type: LOCAL
   
     proxy.opentracing.enabled: false
     proxy.hint.enabled: false
     query.with.cipher.column: true
     sql.show: true
     allow.range.query.with.inline.sharding: false
   
   
   orchestration:
     orchestration_ds:
       orchestrationType: registry_center,config_center,distributed_lock_manager
       instanceType: zookeeper
       serverLists: localhost:2181
       namespace: orchestration
       props:
         overwrite: true
         retryIntervalMilliseconds: 500
         timeToLiveSeconds: 60
         maxRetries: 3
         operationTimeoutMilliseconds: 500
   
   
   config-sharding.yaml:
   
   schemaName: sharding_db
   
   dataSources:
     ds_0:
       url: jdbc:mysql://10.72.12.62:3306/aow_cian_02?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
     ds_1:
       url: jdbc:mysql://10.72.12.62:3306/aow_cian_01?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
   shardingRule:
     tables:
       profile:
         actualDataNodes: ds_${0..1}.profile
         databaseStrategy:
           standard:
             shardingColumn: id
             preciseAlgorithmClassName: com.idreamsky.shardingalgorithm.IdreamSkyShardingAlgorithm
             rangeAlgorithmClassName: com.idreamsky.shardingalgorithm.IdreamSkyShardingAlgorithm
     bindingTables:profile
     defaultDataSourceName: ds_0
     defaultDatabaseStrategy:
       none:
     defaultTableStrategy:
       none:


----------------------------------------------------------------
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] jingshanglu commented on issue #7847: Garbled characters when inserting Chinese data

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


   @xuxinstyle Can you set `sql.show=ture`,and then show the actual sql?


----------------------------------------------------------------
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] xuxinstyle commented on issue #7847: Garbled characters when inserting Chinese data

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


   > @xuxinstyle Can you set `sql.show=ture`,and then show the actual sql?
   ![image](https://user-images.githubusercontent.com/29884085/96440439-8e50df80-123a-11eb-900a-85bacb0b0a6a.png)
   
   


----------------------------------------------------------------
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] xuxinstyle commented on issue #7847: Garbled characters when inserting Chinese data

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


   > @xuxinstyle I test it on master, the statement generated by the parser is correct, maybe a problem with the character set settings.
   How should I set it character?


----------------------------------------------------------------
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 #7847: Garbled characters when inserting Chinese data

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


   @jingshanglu Thanks for the explanation.
    @xuxinstyle Thanks for your feedback, which will help others I suppose. :)


----------------------------------------------------------------
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] xuxinstyle commented on issue #7847: Garbled characters when inserting Chinese data

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


   ![image](https://user-images.githubusercontent.com/29884085/96440391-7c6f3c80-123a-11eb-80d5-4dd46cd2bdd2.png)
   


----------------------------------------------------------------
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] xuxinstyle removed a comment on issue #7847: Garbled characters when inserting Chinese data

Posted by GitBox <gi...@apache.org>.
xuxinstyle removed a comment on issue #7847:
URL: https://github.com/apache/shardingsphere/issues/7847#issuecomment-712021896


   ![image](https://user-images.githubusercontent.com/29884085/96440391-7c6f3c80-123a-11eb-80d5-4dd46cd2bdd2.png)
   


----------------------------------------------------------------
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 closed issue #7847: Garbled characters when inserting Chinese data

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


   


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