Bug #91170 Connection encoding issue
Submitted: 7 Jun 2018 10:09 Modified: 8 Jun 2018 6:49
Reporter: Luigi Gualtieri Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:6.3.10, 8.0.11rc OS:Windows (10pro)
Assigned to: CPU Architecture:x86 (64)

[7 Jun 2018 10:09] Luigi Gualtieri
Description:
I hit a problem when I start updating a utf8mb4 table:

 SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\x9F\x91\x8D' ...' for column 'description'

As I can see, there's no way to specify the encoding in connection settings

How to repeat:
*

Suggested fix:
A combo with possible encoding in connection setting is needed.
[7 Jun 2018 14:38] MySQL Verification Team
Thank you for the bug report. This looks not a bug with WorkBench, please fill the field with exactly OS you are using, try the update you are trying to do with command client mysql(.exe) and print here. Thanks.
[7 Jun 2018 16:06] Luigi Gualtieri
I'm trying to insert a 4byte UTF8 char (U+1F44D 👍) into a utf8mb4 table with Workbench (win x64).

As requested the mysql commands:

correct behaviour:
mysql --defaults-file=defaults.cnf --default-character-set=utf8mb4 -e "insert into test.test_table (test) values ('👍');";

replicates workbench's behaviour.

mysql --defaults-file=defaults.cnf --default-character-set=utf8  -e "insert into test.test_table (test) values ('👍');";

ERROR 1366 (22007) at line 1: Incorrect string value: '\xF0\x9F\x91\x8D' for column 'test' at row 1

It's looks like Workbench is connecting default-character-set=utf8.
[7 Jun 2018 16:31] Peter Laursen
Did you try to execute "SET NAMES utf8mb4;" and then try to insert in same connection? The combo you request would do nothing else but SET NAMES (https://dev.mysql.com/doc/refman/5.7/en/set-names.html). 

You could also try to execute "SHOW VARIABLES LIKE 'char%';" to see current settings. 

-- Peter
-- Not a MySQL/Oracle person
[8 Jun 2018 6:49] Chiranjeevi Battula
Hello Luigi Gualtieri,

Thank you for the bug report.
I could not repeat the issue at our end using with MySQL Workbench 8.0.11 version on Windows 10.
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Thanks,
Chiranjeevi.