Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#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.

django-developers discussion and WIP PR.

Attachments (1)

window-expression-failures.txt (11.2 KB ) - added by Tim Graham 6 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 by Claude Paroz, 6 years ago

This PR addresses the GIS part.

comment:2 by Mariusz Felisiak, 6 years ago

Cc: Mariusz Felisiak added

comment:3 by Tom Forbes, 6 years ago

Cc: Tom Forbes 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:4 by Tim Graham <timograham@…>, 6 years ago

In 45c035c8:

Refs #29548 -- Fixed non-GIS test failures on MariaDB.

comment:5 by Tim Graham, 6 years ago

I installed MariaDB 10.3 and found the attached test failures for window expressions.

by Tim Graham, 6 years ago

comment:6 by Claude Paroz <claude@…>, 6 years ago

In c28bf990:

Refs #29548 -- Fixed GIS tests on MariaDB

comment:7 by Tom Forbes, 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:8 by Tim Graham <timograham@…>, 6 years ago

In 4198445:

Refs #29548 -- Fixed failing window tests on MariaDB 10.3.

comment:9 by Mariusz Felisiak, 5 years ago

Owner: changed from nobody to Mariusz Felisiak
Status: newassigned
Summary: Add official support for MariaDBAdd 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:10 by Mariusz Felisiak, 5 years ago

Has patch: set
Last edited 5 years ago by Mariusz Felisiak (previous) (diff)

comment:11 by Claude Paroz, 5 years ago

@felixxm your PR link is self-referencing the ticket.

comment:12 by Mariusz Felisiak, 5 years ago

Good point thanks, fixed.

comment:13 by GitHub <noreply@…>, 5 years ago

In b6c4766:

Refs #29548 -- Updated docs for MariaDB support.

comment:14 by Mariusz Felisiak, 5 years ago

Resolution: fixed
Status: assignedclosed

comment:15 by GitHub <noreply@…>, 5 years ago

In fc2536f:

Refs #29548 -- Doc'd MariaDB support for GIS database functions.

comment:16 by GitHub <noreply@…>, 5 years ago

In 8d52a525:

Refs #29548 -- Fixed DatabaseWrapper.display_name on MariaDB.

comment:17 by GitHub <noreply@…>, 4 years ago

In 6e026ae:

Refs #29548 -- Mentioned MariaDB in database system checks.

Note: See TracTickets for help on using tickets.
Back to Top