#29548 closed New feature (fixed)
Add official support for MariaDB.
Reported by: | Tim Graham | Owned by: | Mariusz Felisiak |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Mariusz Felisiak, Tom Forbes | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The MySQL backend mostly works with MariaDB but there are a few test failures, mainly regarding feature detection based on version number.
Attachments (1)
Change History (18)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Cc: | added |
---|
comment:3 by , 6 years ago
Cc: | added |
---|
I've fixed all the failing non-gis tests here: https://github.com/django/django/pull/10135
I've been thinking about how to best support version checking both MySQL and MariaDB. You always have to check the MariaDB and MySQL versions carefully as they are numerically comparable but not logically. connection.mysql_version > (8, 0, 0)
is True for all MariaDB versions, even if the feature you're testing is not compatible. We could add a mariadb_version
property that returns an object that always compares to False if the database is not Mariadb, and vice versa for mysql_version
?
comment:5 by , 6 years ago
I installed MariaDB 10.3 and found the attached test failures for window expressions.
by , 6 years ago
Attachment: | window-expression-failures.txt added |
---|
comment:7 by , 6 years ago
PR for window function failures: https://github.com/django/django/pull/10228
I've not had much experience with window expressions, but after doing some exploration it seems MariaDB has a few annoying quirks. Firstly the results of a query that uses window functions are not implicitly ordered, so the ordering has to be repeated. All examples in the MariaDB KB show this: https://mariadb.com/kb/en/library/window-functions-overview/. For these tests I just added a conditional .order()
call if it's MariaDB.
Secondly 'RANGE' frames have a limitation that's not present in other databases (https://jira.mariadb.org/browse/MDEV-11747). For this I just adapted the test to work around this limitation.
And lastly LEAD
and LAG
have no default
parameter (https://jira.mariadb.org/browse/MDEV-12981). I just skipped these tests.
The PR needs more work done before it's ready, but if I don't have time I thought I would share what I've got so far for anyone else to pick up. Tests pass locally with MariaDB 10.3.
comment:9 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Summary: | Add official support for MariaDB → Add official support for MariaDB. |
IMO we are almost ready to close this ticket. MariaDB is now officially supported, we should document that and add release notes.
comment:14 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This PR addresses the GIS part.