Bug #106251 Problem working with emoticons with ODBC driver for Windows
Submitted: 23 Jan 14:38 Modified: 19 May 3:46
Reporter: Rino G Email Updates:
Status: Analyzing Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:8.0.28 OS:Windows (Windows 10)
Assigned to: MySQL Verification Team CPU Architecture:x86 (Intel I7-2630QM)

[23 Jan 14:38] Rino G
Description:
Hi,
with reference to this fixed bug:
https://bugs.mysql.com/bug.php?id=104346

I made some test saving and retrieving emoticons on a default installation of MySql 8.0.28 and I found some problems analyzed below.

How to repeat:
And here are the results selecting and inserting this chars: 🥰❤️

TEST 1 SELECT (classic asp, no charset indicated in the connection)
conn.Open "DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost; DATABASE=test1; UID=test;PASSWORD=test;"

Result: 🥰❤️

----------

TEST 2 SELECT (classic asp, charset utf8)
conn.Open "DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost; DATABASE=test1; UID=test;PASSWORD=test;charset=utf8;"

Result: 🥰❤️ (the same of TEST 1)

----------

TEST 3 SELECT (classic asp, charset utf8mb4)
conn.Open "DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost; DATABASE=test1; UID=test;PASSWORD=test;charset=utf8mb4;"

Result: 🥰❤️

----------

So, SELECT strings containing emoticons is displayed incorrectly with charset "utf8mb4" and right with empty charset or "utf8" value. Is that right or maybe should it be the opposite?

INSERT operation instead gives always this error with any charset indicated:

-2147467259 - [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.28]Incorrect string value: '\xF0\x9F\xA5\xB0\xE2\x9D...' for column 'first_name' at row 1

So, the INSERT command doesn't work at all. Am I forgot something? I tested also another third party driver for MySQl and it works right both selecting and inserting emoticons, without any extra code.

Suggested fix:
I think that everything should be fine using "utf8mb4" charset in connection parameters, so maybe at the moment there are some conversions that are not made directly into the driver.

Best regards.
[16 May 12:38] MySQL Verification Team
Hello Rino,

Thank you for the bug report.
Could you please provide repeatable test case(please make it as private if you prefer) to reproduce this issue at our end? Thank you.

Regards,
Ashwini Patil