Bug #106251 Problem working with emoticons with ODBC driver for Windows
Submitted: 23 Jan 2022 14:38 Modified: 12 Jul 2022 22:09
Reporter: Rino G Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:8.0.28 OS:Windows (Windows 10)
Assigned to: CPU Architecture:x86 (Intel I7-2630QM)

[23 Jan 2022 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 2022 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
[12 Jul 2022 12:50] MySQL Verification Team
Hello Rino,

Thank you for the details.
Imho this is duplicate of Bug #107698, please see Bug #107698.

Regards,
Ashwini Patil
[12 Jul 2022 19:56] Philip Olson
Note: a fix is scheduled for the upcoming 8.0.30 release as described here:

https://bugs.mysql.com/bug.php?id=107698
[12 Jul 2022 22:09] Rino G
Hi Mr. Patil,
imho it's the other one the duplicate ticket since I reported this thing almost six months ago.

Best regards