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/10/13 12:44:26 UTC

[GitHub] [shardingsphere] colinchouzgl opened a new issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

colinchouzgl opened a new issue #13023:
URL: https://github.com/apache/shardingsphere/issues/13023


   The exception occurred while inserting string value with emoji using ShardingSphere-Proxy. But sometimes it worked well.
   
   ```
   [ERROR] 2021-10-13 19:23:08.131 [ShardingSphere-Command-18487] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   java.sql.SQLException: Incorrect string value: '\xF0\x9F\xA5\x9B\xF0\x9F...' for column 'content' at row 1
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)
   	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
   	at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:790)
   	at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:808)
   	at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:103)
   	at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.impl.ProxyStatementExecutorCallback.execute(ProxyStatementExecutorCallback.java:40)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:73)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:66)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:44)
   	at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:85)
   	at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:64)
   	at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:101)
   	at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.parallelExecute(ExecutorEngine.java:97)
   	at org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:82)
   	at org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:65)
   	at org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.ProxyJDBCExecutor.execute(ProxyJDBCExecutor.java:71)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:184)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:137)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:126)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxyLockEngine.doExecute(ProxyLockEngine.java:103)
   	at org.apache.shardingsphere.proxy.backend.communication.ProxyLockEngine.execute(ProxyLockEngine.java:81)
   	at org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.execute(DatabaseCommunicationEngine.java:126)
   	at org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.execute(SchemaAssignedDatabaseBackendHandler.java:55)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:57)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:99)
   	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   ```
   
   SQL example:
   ```
   INSERT INTO msg_chat_message_18 (content) VALUES ('欢迎牛奶🥛🥛🥛');
   ```
   The charset of the db column is 'utf8mb4'
   
   version: compiled from source code on master branch (commit bf812c0e85afa392c4013cb71fd2945f75189f81)


-- 
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 closed issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


   


-- 
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 #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


   @colinchouzgl 
   Yes, the situation I said is the same as yours, not every time.
   
   Are you using sharding?
   If there are sharding tables, but the tables have different character sets, occasional exceptions will occur.
   If it is sharding, you need to check all tables (in every database).


-- 
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] colinchouzgl commented on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


   @TeslaCN 
   The charset configured in JDBC url is `utf8` (cuz `utf8mb4` is not supported). Should I just remove it?
   
   @RaigorJiang 
   But the charset of the table is `utf8mb4`, same as the database. And the point is the error doesn't occur every time. Sometimes the emoji can be inserted successfully.


-- 
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 #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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






-- 
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] colinchouzgl removed a comment on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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






-- 
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] colinchouzgl removed a comment on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


    @TeslaCN 


-- 
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] colinchouzgl commented on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


   The charset of the table is utf8mb4, too.


-- 
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] TeslaCN edited a comment on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

Posted by GitBox <gi...@apache.org>.
TeslaCN edited a comment on issue #13023:
URL: https://github.com/apache/shardingsphere/issues/13023#issuecomment-942891976


   Hi @contextshuffling 
   Did you configured charset in JDBC 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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] colinchouzgl commented on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


    @TeslaCN 


-- 
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] colinchouzgl removed a comment on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


   The charset of the table is utf8mb4, too.


-- 
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] TeslaCN commented on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


   Did you configured charset in JDBC 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.

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 #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


   It seems that the problem has been resolved, I will close this issue.
    if the problem recurs, you can reopen it or submit a new issue.


-- 
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] colinchouzgl commented on issue #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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






-- 
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 #13023: "Incorrect string value" SQLException while inserting data with emoji(doesn't occur everytime)

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


   A user encountered a similar problem before, and his charset of the database is `utf8mb4` too. 
   But then we found the root problem is that the character set of the `table` in this database is not `utf8mb4`, but `utf8`. 
   So, I suggest you also check the character set of the table.


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