Skip to content

Conversation

@janbrasna
Copy link
Contributor

When investigating #341 using the boilerplate .env-dist connection strings locally, it shows that the defaults used for connecting to mariadb would trigger DataError ("Incorrect string value") exception with certain content posted:

Screenshot 2025-05-02 at 16 34 05

It turns out I was able to post either Latin-ext or non-Latin Unicode scripts successfully, or use e.g. a heart ❤️ emoji — however the app would crash if I tried anything more astral as facepalming 🤦 monkeys 🙈 et al. …

(passed:)
Screenshot 2025-05-02 at 17 16 02

(crashed:)
Screenshot 2025-05-02 at 16 34 24 Large

The default charset=utf8 used is actually utf8mb3, not full utf8mb4, so that effectively rules out emoji etc.:/ — TL;DR: https://forum.djangoproject.com/t/ticket-18392-and-mysql-utf8mb4/34916

This won't magically fix production tables and collation for mb4 storage, but is currently needed for the Django versions used to at least stop crashing on such content locally.

Passing this arg to dj_database_url here expands it into OPTIONS correctly, as can be seen below running this tweak locally and being able to insert emoji: … ;)

Screenshot 2025-05-02 at 17 16 06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant