character set encoding bug in connector 5.1.36/5.1.37?
Posted by: Lucas Jackson
Date: October 20, 2015 02:13PM

I have a java app that puts tweets into mysql.
On 5.1.36/5.1.37 when i try to insert something with an emoji, e.g. U+1F603, it throws an exception, namely:

Incorrect string value: '\xF0\x9F\x98\x83' for column 'text' at row 1

Works ok on 5.1.35 and 5.1.33.

Any help is appreciated.

Versions:
OS: CentOS 6.5
Tomcat: 8.0.26
Java: 1.7.0_79-b15
MySQL Cluster: 5.6.25-ndb-7.4.7-log

my.cnf
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
default-character-set = utf8mb4

mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_general_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+

mysql> select table_collation from tables where table_name = 'tweet';
+--------------------+
| table_collation |
+--------------------+
| utf8mb4_general_ci |
+--------------------+

mysql> select character_set_name,collation_name from columns where table_name = 'tweet' and column_name = 'text';
+--------------------+--------------------+
| character_set_name | collation_name |
+--------------------+--------------------+
| utf8mb4 | utf8mb4_general_ci |
+--------------------+--------------------+

JDBC:
url="jdbc:mysql:loadbalance://
host1,host2/db?
connectTimeout=1000
&
loadBalancePingTimeout=100
&
loadBalanceBlacklistTimeout=10000
&
retriesAllDown=2
&
failOverReadOnly=false
&
loadBalanceStrategy=bestResponseTime
&
loadBalanceValidateConnectionOnSwapServer=true
&
allowMasterDownConnections=true
&
noAccessToProcedureBodies=true
&
cacheServerConfiguration=true
&
dontTrackOpenResources=true
&
elideSetAutoCommits=true
&
enableQueryTimeouts=false
&
maintainTimeStats=false
&
useLocalSessionState=true"

Options: ReplyQuote


Subject
Written By
Posted
character set encoding bug in connector 5.1.36/5.1.37?
October 20, 2015 02:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.