-
-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for utf8mb3 #3007
base: master
Are you sure you want to change the base?
Add support for utf8mb3 #3007
Conversation
Yes, it's an old encoding that myswl is phasing out. However, some DBs out there still use it. Some servers (like ours) have some default connection setting that is still set to utf8mb3 even though all our columns / tables are in utf8mb4. Ironically, if you run a query that has *no results* (REPLACE, DELETE, ...) then the metadata in the empty result set is set to the server's default charset. If that happens to utf8mb3, this library crashes.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3007 +/- ##
=======================================
Coverage 88.13% 88.13%
=======================================
Files 71 71
Lines 12889 12890 +1
Branches 1352 1353 +1
=======================================
+ Hits 11360 11361 +1
Misses 1529 1529
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks, @danielbeardsley 🙋🏻♂️
Could you explain how these changes affect #2640? |
I realize there likely could be several different causes of that error, but that's the error I got when I had this same utf8mb3 problem in single-connection mode. While using a pool connection, I received the error from #1398. You're welcome to drop that "Closes" if you think it should stay open. |
let's drop #2640 , I'm not convinced it's directly related |
I'm trying to find some references to confirm mysql charset name <-> code <-> iconv charset name mapping
|
for a context, cesu8: https://en.wikipedia.org/wiki/CESU-8 |
This is what I get on our DB.
|
@danielbeardsley could you check if there is any missing charset id in addition to 192? Everything from your table needs to map to utf8 I believe, they only differ in collation / case sensitivity which does not apply to the driver |
I'm not sure I understand. Missing from where? The Oh wait, you mean utilize Here, I included their ids too: Are you suggesting I add these with their ids to |
Yes, it's an old encoding that mysql is phasing out. However, some DBs out there still use it and this library shouldn't crash in unexpected ways. Some servers (like ours) have some default connection settings that are still set to utf8mb3 even though all our columns / tables are in utf8mb4.
Ironically, if you run a query that has no results (REPLACE, DELETE, ...) then the metadata in the empty resultset is set to the server's default charset. If that happens to be
utf8mb3
, this library crashes.Closes #1398
Co-Author @davidrans