Bug #86454 Workbench can't process utf8mb4 encode
Submitted: 25 May 2017 7:34 Modified: 16 May 2018 19:18
Reporter: yitao Xu Email Updates:
Status: Closed Impact on me:
Category:MySQL Workbench Severity:S2 (Serious)
Version:6.3.9 OS:Windows (commercial version)
Assigned to: CPU Architecture:Any
Tags: collation, utf8mb4, workbench

[25 May 2017 7:34] yitao Xu
When character set utf8mb4, execute“select 'ア';”  an error code was reported.
"Error Code: 0 Server sent unknown charsetnr (255) . Please report"

'ア' is a Japanese katakana.

MySQL server :8.0.2-dmr-enterprise-commercial-advanced-log

How to repeat:
In workbench editor, execute below SQL:

set NAMES utf8mb4;
select 'ア';
Error Code: 0 Server sent unknown charsetnr (255) . Please report

In mysql client, execute the same SQL:

mysql> set NAMES utf8mb4;
Query OK, 0 rows affected (0.00 sec)

mysql> select 'ア';
| ア  |
| ア  |
1 row in set (0.00 sec)


if execute below SQL in Workbench, result is good.
set NAMES utf8;
select 'ア';

Suggested fix:
Fix the bug, workbench don't know the character which has been set utf8mb4
[25 May 2017 9:14] Peter Laursen
Ia m no expert in Japanese, but I believe that tThis particular character is a 3-byte UTF8 character, so utf8(mb3) and utf8mb4 shold make no difference. 

In SQLyog using the font "courier new" it works fine:
SET NAMES utf8; -- or "SET NAMES utf8mb4;" - it doesnt matter  
SELECT 'ア'; -- returns 'ア 
SELECT HEX('ア'); -- returns 'E382A2' - note here 3 bytes only

It may be a font problem you are facing. What exactly does WB display for you? You can attach a screenshot. 

-- Peter
-- not an Oracle/MySqL person.
[25 May 2017 9:15] Peter Laursen
OK, it displays an error.  I missed that.
[25 May 2017 10:18] MySQL Verification Team
select 'ア'

Attachment: utf8mb4.png (image/png, text), 86.05 KiB.

[25 May 2017 12:28] MySQL Verification Team
When connected with 8.0

Attachment: mb4.png (image/png, text), 181.99 KiB.

[25 May 2017 12:30] MySQL Verification Team
Thank you for the bug report. This only happens when connected with server 8.0.X.
[25 May 2017 12:58] Peter Laursen
Maybe it could be a Connector/C++ issue?
[26 May 2017 0:58] yitao Xu
Thank you for verified it.
For this bug,execute 
set NAMES utf8mb4;
select 'a';
also get the same error.

If you think this is maybe a connector C++ issue, could you report it or provide  me some evidence or hint, I can report the problem.
[16 May 2018 19:18] Christine Cole
Posted by developer:
Fixed as of the upcoming MySQL Workbench 8.0.12 release, and here's the changelog entry:

The SQL editor returned an error when valid characters were used with the
utf8mb4 character set.

Thank you for the bug report.