#31797 closed Bug (fixed)
MariaDB 10.4 SchemaTests failures
| Reported by: | Tom Forbes | Owned by: | Mariusz Felisiak |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | MariaDB |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
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
Change History (8)
comment:1 by , 5 years ago
| Keywords: | MariaDB added |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
comment:2 by , 5 years ago
| Easy pickings: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
test_alter_not_unique_field_to_primary_key failure is related with 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+).
comment:3 by , 5 years ago
| Resolution: | invalid |
|---|---|
| Status: | closed → new |
comment:4 by , 5 years ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
We can close it as needsinfo after merging PR 13215 because I cannot reproduce test_alter_pk_with_self_referential_field failure.
comment:5 by , 5 years ago
OK I finally reproduce the second failure it's also an issue in MariaDB 10.4.13+, see MDEV-22775. I will update PR.
This is a regression in MariaDB 10.4.4, see MDEV-19598. There is not much we can do, IMO.