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 Version 1

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 (last modified by Aaron Blair)

When running unit tests, the internal testing of a db for using transactions breaks when using MySQL Cluster server v8.0.28 because that db version 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)")

Change History (1)

comment:1 by Aaron Blair, 15 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top