You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, when working on #458, I discovered that our current ORM code doesn't really work with MySQL. It turns out that our Session DB backend fails to run under MySQL because it specifies a TEXT UNIQUE column as a session key, which is unsupported on MySQL. The same exact model works just fine under PostgreSQL, SQLite, as well as a popular fork of MySQL, MariaDB.
This happened because our test framework have used MariaDB instead of MySQL. In MariaDB, there is no such limitation and users are free to define TEXT UNIQUE columns.
There are several options to solve this problem:
change the session item model to use LimitedString instead of String
change the MySQL ORM backend so that when it sees TEXT UNIQUE, it internally changes it to something like STRING(255) UNIQUE instead
continue using MariaDB and drop support for MySQL completely
Option 1 is backwards-incompatible (this probably doesn't hurt us much), but in my opinion, the bigger problem is that we drive the API by one of the implementations. Other ORM backends are not limited by this, so it seems pointless to enforce this on them.
Option 2 sounds like silent limitations that will only expose themselves in runtime. Users might be surprised that they are able to use long session entry keys in other database engines, whereas the same session keys will fail in MySQL. What's even worse, the same thing will happen with their own models that have a unique String field.
Option 3 sounds like something I'm personally very willing to do. Supporting MySQL has been a pain before - for instance, our bulk_insert code is essentially broken right now on MySQL, because it needs to use a separate SELECT query after INSERT since MySQL doesn't support the RETURNING clause (again, something that has been supported in MariaDB for a while):
MariaDB has been around for quite a while, is a much more powerful database engine, and it seems like it's popular, too - for instance, it's used on the majority of WordPress installations.
Since our time is limited and so far nobody has even complained about broken MySQL support, I would suggest us to drop the support for it and focus on MariaDB instead.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Recently, when working on #458, I discovered that our current ORM code doesn't really work with MySQL. It turns out that our Session DB backend fails to run under MySQL because it specifies a
TEXT UNIQUEcolumn as a session key, which is unsupported on MySQL. The same exact model works just fine under PostgreSQL, SQLite, as well as a popular fork of MySQL, MariaDB.This happened because our test framework have used MariaDB instead of MySQL. In MariaDB, there is no such limitation and users are free to define
TEXT UNIQUEcolumns.There are several options to solve this problem:
LimitedStringinstead ofStringTEXT UNIQUE, it internally changes it to something likeSTRING(255) UNIQUEinsteadOption 1 is backwards-incompatible (this probably doesn't hurt us much), but in my opinion, the bigger problem is that we drive the API by one of the implementations. Other ORM backends are not limited by this, so it seems pointless to enforce this on them.
Option 2 sounds like silent limitations that will only expose themselves in runtime. Users might be surprised that they are able to use long session entry keys in other database engines, whereas the same session keys will fail in MySQL. What's even worse, the same thing will happen with their own models that have a unique
Stringfield.Option 3 sounds like something I'm personally very willing to do. Supporting MySQL has been a pain before - for instance, our
bulk_insertcode is essentially broken right now on MySQL, because it needs to use a separateSELECTquery afterINSERTsince MySQL doesn't support theRETURNINGclause (again, something that has been supported in MariaDB for a while):cot/cot/src/db.rs
Lines 1666 to 1701 in ae9de54
MariaDB has been around for quite a while, is a much more powerful database engine, and it seems like it's popular, too - for instance, it's used on the majority of WordPress installations.
Since our time is limited and so far nobody has even complained about broken MySQL support, I would suggest us to drop the support for it and focus on MariaDB instead.
Beta Was this translation helpful? Give feedback.
All reactions