[Django] #31797: MariaDB 10.4 SchemaTests failures

29 views
Skip to first unread message

Django

unread,
Jul 17, 2020, 3:48:18 PM7/17/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom | Owner: nobody
Forbes |
Type: Bug | Status: new
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Running the master test suite on MariaDB 10.4 currently results in two
errors:


{{{
======================================================================
ERROR [0.051s]: test_alter_not_unique_field_to_primary_key
(schema.tests.SchemaTests)
----------------------------------------------------------------------

Traceback (most recent call last):
File "/tests/django/tests/schema/tests.py", line 720, in
test_alter_not_unique_field_to_primary_key
editor.alter_field(Author, old_field, new_field, strict=True)
File "/tests/django/django/db/backends/base/schema.py", line 572, in
alter_field
old_db_params, new_db_params, strict)
File "/tests/django/django/db/backends/base/schema.py", line 776, in
_alter_field
self.execute(self._create_primary_key_sql(model, new_field))
File "/tests/django/django/db/backends/base/schema.py", line 142, in
execute
cursor.execute(sql, params)
File "/tests/django/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False,
executor=self._execute)
File "/tests/django/django/db/backends/utils.py", line 75, in
_execute_with_wrappers
return executor(sql, params, many, context)
File "/tests/django/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/tests/django/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/tests/django/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/tests/django/django/db/backends/mysql/base.py", line 73, in
execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/cursors.py", line
206, in execute
res = self._query(query)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/cursors.py", line
319, in _query
db.query(q)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/connections.py",
line 259, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1280, "Incorrect index name
'schema_author_uuid_a01c5261_uniq'")

======================================================================
ERROR [0.028s]: test_alter_pk_with_self_referential_field
(schema.tests.SchemaTests)
----------------------------------------------------------------------

Traceback (most recent call last):
File "/tests/django/tests/schema/tests.py", line 2954, in
test_alter_pk_with_self_referential_field
editor.alter_field(Node, old_field, new_field, strict=True)
File "/tests/django/django/db/backends/base/schema.py", line 572, in
alter_field
old_db_params, new_db_params, strict)
File "/tests/django/django/db/backends/base/schema.py", line 668, in
_alter_field
self.execute(self._rename_field_sql(model._meta.db_table, old_field,
new_field, new_type))
File "/tests/django/django/db/backends/base/schema.py", line 142, in
execute
cursor.execute(sql, params)
File "/tests/django/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False,
executor=self._execute)
File "/tests/django/django/db/backends/utils.py", line 75, in
_execute_with_wrappers
return executor(sql, params, many, context)
File "/tests/django/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/tests/django/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/tests/django/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/tests/django/django/db/backends/mysql/base.py", line 73, in
execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/cursors.py", line
206, in execute
res = self._query(query)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/cursors.py", line
319, in _query
db.query(q)
File "/usr/local/lib/python3.7/site-packages/MySQLdb/connections.py",
line 259, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1553, "Cannot drop index 'PRIMARY':
needed in a foreign key constraint")

----------------------------------------------------------------------
}}}


I tested this with django-docker-box with the following command:

{{{
DJANGO_PATH=path PYTHON_VERSION=3.7 MARIADB_VERSION=10.4 docker-compose
run mariadb schema.tests.SchemaTests
}}}

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

Django

unread,
Jul 17, 2020, 5:12:34 PM7/17/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: MariaDB | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* keywords: => MariaDB
* status: new => closed
* resolution: => invalid


Comment:

This is a regression in MariaDB 10.4.3, see
[https://jira.mariadb.org/browse/MDEV-19598 MDEV-19598]. There is not much
we can do, IMO.

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

Django

unread,
Jul 18, 2020, 1:46:48 AM7/18/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: MariaDB | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

`test_alter_not_unique_field_to_primary_key` failure is related with
[https://jira.mariadb.org/browse/MDEV-19598 MDEV-19598] that looks to be
fixed in MariaDB 10.5.2, so we can skip this test on MariaDB 10.4.4 to
10.5.1.

I cannot reproduce `test_alter_pk_with_self_referential_field` failure (I
checked on MariaDB 10.4.3, 10.4.4, 10.4.5, 10.4.11, 10.4.12, 10.5+).

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

Django

unread,
Jul 18, 2020, 1:48:18 AM7/18/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: MariaDB | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

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


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

Django

unread,
Jul 21, 2020, 7:10:23 AM7/21/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: felixxm
Type: Bug | Status: assigned

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: MariaDB | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* owner: nobody => felixxm
* status: new => assigned
* has_patch: 0 => 1


Comment:

We can close it as `needsinfo` after merging
[https://github.com/django/django/pull/13215 PR 13215] because I cannot
reproduce `test_alter_pk_with_self_referential_field` failure.

--
Ticket URL: <https://code.djangoproject.com/ticket/31797#comment:4>

Django

unread,
Jul 21, 2020, 10:14:20 AM7/21/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: felixxm
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: MariaDB | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

OK I finally reproduce the second failure it's also an issue in MariaDB
10.4.13+, see [https://jira.mariadb.org/browse/MDEV-22775 MDEV-22775]. I
will update PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/31797#comment:5>

Django

unread,
Jul 22, 2020, 4:57:56 AM7/22/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: felixxm
Type: Bug | Status: closed

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

Keywords: MariaDB | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

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


Comment:

In [changeset:"c071c408d72330b422c124a6bdd85a68acae9566" c071c408]:
{{{
#!CommitTicketReference repository=""
revision="c071c408d72330b422c124a6bdd85a68acae9566"
Fixed #31797 -- Skipped schema tests on specific MariaDB versions.

test_alter_not_unique_field_to_primary_key() test is affected by
https://jira.mariadb.org/browse/MDEV-19598 on MariaDB 10.4.4 to 10.5.1.

test_alter_pk_with_self_referential_field() test is affected by
https://jira.mariadb.org/browse/MDEV-22775 on MariaDB 10.4 series
from 10.4.13.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31797#comment:6>

Django

unread,
Jul 22, 2020, 4:58:38 AM7/22/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: felixxm
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: MariaDB | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"7a3fa3af68809e71d18fedc673ab64152e8940b9" 7a3fa3af]:
{{{
#!CommitTicketReference repository=""
revision="7a3fa3af68809e71d18fedc673ab64152e8940b9"
[3.1.x] Fixed #31797 -- Skipped schema tests on specific MariaDB versions.

test_alter_not_unique_field_to_primary_key() test is affected by
https://jira.mariadb.org/browse/MDEV-19598 on MariaDB 10.4.4 to 10.5.1.

test_alter_pk_with_self_referential_field() test is affected by
https://jira.mariadb.org/browse/MDEV-22775 on MariaDB 10.4 series
from 10.4.13.

Backport of c071c408d72330b422c124a6bdd85a68acae9566 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31797#comment:7>

Django

unread,
Jul 22, 2020, 4:59:19 AM7/22/20
to django-...@googlegroups.com
#31797: MariaDB 10.4 SchemaTests failures
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: felixxm
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: MariaDB | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"1a81d34e70bdffbb563e053c3178ab885436c00c" 1a81d34]:
{{{
#!CommitTicketReference repository=""
revision="1a81d34e70bdffbb563e053c3178ab885436c00c"
[3.0.x] Fixed #31797 -- Skipped schema tests on specific MariaDB versions.

test_alter_not_unique_field_to_primary_key() test is affected by
https://jira.mariadb.org/browse/MDEV-19598 on MariaDB 10.4.4 to 10.5.1.

test_alter_pk_with_self_referential_field() test is affected by
https://jira.mariadb.org/browse/MDEV-22775 on MariaDB 10.4 series
from 10.4.13.
Backport of c071c408d72330b422c124a6bdd85a68acae9566 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31797#comment:8>

Reply all
Reply to author
Forward
0 new messages