Bug #54175 Connector/J cannot handle supplemental characters supported by utf8mb4
Submitted: 2 Jun 2010 10:03 Modified: 18 Jun 2010 15:55
Reporter: Mikiya Okuno Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version: OS:Any
Assigned to: CPU Architecture:Any

[2 Jun 2010 10:03] Mikiya Okuno
Description:
Connector/J cannot handle supplemental characters such as u2F9B2. C API can handle them, but Connector/J cannot.

How to repeat:
Run the attached java program. The expected output is like below, but the actually it gets garbled.

mysql [localhost] {msandbox} (test) > select * from t99;
+------+
| a    |
+------+
| 䕫   |
+------+
1 row in set (0.00 sec)

Suggested fix:
no idea
[2 Jun 2010 10:04] MySQL Verification Team
Adjust host, port, user and password.

Attachment: testmb4.java (application/octet-stream, text), 2.23 KiB.

[7 Jun 2010 12:33] Tonci Grgin
Mikiya, if you want you can try this diff. I'll test it today or tomorrow.
[18 Jun 2010 15:04] Mark Matthews
Fixed for 5.1.13.

From the changelog:

"Driver doesn't support utf8mb4 for servers 5.5.2 and newer. The
      driver now auto-detects servers configured with character_set_server=utf8mb4 or
      treats the Java encoding "utf-8" passed via "characterEncoding=..." as utf8mb4 in
      the "SET NAMES=" calls it makes when establishing the connection."
[18 Jun 2010 15:55] Tony Bedford
An entry has been added to the 5.1.13 changelog:

Connector/J did not support utf8mb4 for servers 5.5.2 and newer.

Connector/J now auto-detects servers configured with character_set_server=utf8mb4 or treats the Java encoding utf-8 passed via characterEncoding=... as utf8mb4 in the SET NAMES= calls it makes when establishing the connection.