Opened 15 months ago
Last modified 10 months ago
#34852 closed Bug
Django Unit Tests break when using replicated MySQL Cluster v8.0.28 — at Initial Version
Reported by: | Aaron Blair | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | 4.1 |
Severity: | Normal | Keywords: | Test MySQL Cluster |
Cc: | Pieter Cardillo Kwok | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When running unit tests, the internal testing of a db for using transactions breaks when using MySQL Cluster server v8.0.28 because it requires a primary key for tables, and this line in https://github.com/django/django/blob/main/django/db/backends/base/features.py breaks it :
@cached_property def supports_transactions(self): """Confirm support for transactions.""" with self.connection.cursor() as cursor: cursor.execute("CREATE TABLE ROLLBACK_TEST (X INT)")
We have been patch-fixing that file as follows:
<- cursor.execute("CREATE TABLE ROLLBACK_TEST (X INT PRIMARY KEY)")
---
-> cursor.execute("CREATE TABLE ROLLBACK_TEST (X INT)")