[Django] #26868: Microsecond precision in MariaDB / Version detection

6 views
Skip to first unread message

Django

unread,
Jul 7, 2016, 9:12:09 AM7/7/16
to django-...@googlegroups.com
#26868: Microsecond precision in MariaDB / Version detection
----------------------------------------------+--------------------
Reporter: marcaurele | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
I found an edge case when you connect to mariadb server using the mysql
client library, for example running a MySQL server on a local computer,
which will install the client library but using a MariaDB in a docker
container.

The server string returned by the server is
{{{5.5.5-10.0.25-MariaDB-1~jessie}}} and therefore the features list is
incorrect, especially for the microsecond precision on the DATETIME. If
you're using the mariadb client library you will get
{{{10.0.25-MariaDB-1~jessie}}} and the features list is correct.

https://mariadb.atlassian.net/browse/MDEV-4575

My patch (PR) changes how the version is detected, and use a SQL query
instead of the client library call. Then we get the correct MariaDB
version and the features list is correct.

--
Ticket URL: <https://code.djangoproject.com/ticket/26868>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 7, 2016, 5:20:05 PM7/7/16
to django-...@googlegroups.com
#26868: Change MySQL version detection to accomodate MariaDB
-------------------------------------+-------------------------------------

Reporter: marcaurele | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* has_patch: 0 => 1
* stage: Unreviewed => Accepted


Old description:

> I found an edge case when you connect to mariadb server using the mysql
> client library, for example running a MySQL server on a local computer,
> which will install the client library but using a MariaDB in a docker
> container.
>
> The server string returned by the server is
> {{{5.5.5-10.0.25-MariaDB-1~jessie}}} and therefore the features list is
> incorrect, especially for the microsecond precision on the DATETIME. If
> you're using the mariadb client library you will get
> {{{10.0.25-MariaDB-1~jessie}}} and the features list is correct.
>
> https://mariadb.atlassian.net/browse/MDEV-4575
>
> My patch (PR) changes how the version is detected, and use a SQL query
> instead of the client library call. Then we get the correct MariaDB
> version and the features list is correct.

New description:

I found an edge case when you connect to mariadb server using the mysql
client library, for example running a MySQL server on a local computer,
which will install the client library but using a MariaDB in a docker
container.

The server string returned by the server is
{{{5.5.5-10.0.25-MariaDB-1~jessie}}} and therefore the features list is
incorrect, especially for the microsecond precision on the DATETIME. If
you're using the mariadb client library you will get
{{{10.0.25-MariaDB-1~jessie}}} and the features list is correct.

https://mariadb.atlassian.net/browse/MDEV-4575

My [https://github.com/django/django/pull/6893 PR] changes how the version


is detected, and use a SQL query instead of the client library call. Then
we get the correct MariaDB version and the features list is correct.

--

Comment:

I'm not a MariaDB/MySQL expert, but tentatively accepting.

--
Ticket URL: <https://code.djangoproject.com/ticket/26868#comment:1>

Django

unread,
Jul 15, 2016, 10:05:42 AM7/15/16
to django-...@googlegroups.com
#26868: Change MySQL version detection to accomodate MariaDB
-------------------------------------+-------------------------------------
Reporter: marcaurele | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"f8bfa806805a87d2cdd677089bd96fbf8400cb95" f8bfa806]:
{{{
#!CommitTicketReference repository=""
revision="f8bfa806805a87d2cdd677089bd96fbf8400cb95"
Fixed #26868 -- Changed MySQL version detection to use a query.

Workaround a bug with MariaDB and MySQL native client not stripping the
`5.5.5-` prefix.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26868#comment:2>

Django

unread,
Jul 15, 2016, 10:30:34 AM7/15/16
to django-...@googlegroups.com
#26868: Change MySQL version detection to accomodate MariaDB
-------------------------------------+-------------------------------------
Reporter: marcaurele | Owner: nobody

Type: Bug | Status: closed
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a8b2445a78620859cf43f3e5c9387e85ab1d9387" a8b2445]:
{{{
#!CommitTicketReference repository=""
revision="a8b2445a78620859cf43f3e5c9387e85ab1d9387"
[1.10.x] Fixed #26868 -- Changed MySQL version detection to use a query.

Workaround a bug with MariaDB and MySQL native client not stripping the
`5.5.5-` prefix.

Backport of f8bfa806805a87d2cdd677089bd96fbf8400cb95 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26868#comment:3>

Reply all
Reply to author
Forward
0 new messages