From 83339d2103f447377fedb3bd145b52c3ef2b667c Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 3 May 2023 07:58:42 +0200 Subject: Fixed #34523 -- Fixed TransactionManagementError in QuerySet.update_or_create() with MyISAM storage engine. QuerySet.update_or_create() uses nested atomic to handle possible integrity errors taking savepoints as way to mark back the connection as usable. Savepoints are not returned when uses_savepoints/can_release_savepoints feature flags are set to False. As a consequence, QuerySet.update_or_create() assumed the outer atomic block is tainted and raised TransactionManagementError. This commit partly reverts 331a460f8f2e4f447b68fba491464b68c9b21fd1. Thanks gatello-s for the report. --- django/db/backends/mysql/features.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'django') diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py index 739ab380e0..9e17d33e93 100644 --- a/django/db/backends/mysql/features.py +++ b/django/db/backends/mysql/features.py @@ -297,9 +297,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): """ return self._mysql_storage_engine != "MyISAM" - uses_savepoints = property(operator.attrgetter("supports_transactions")) - can_release_savepoints = property(operator.attrgetter("supports_transactions")) - @cached_property def ignores_table_name_case(self): return self.connection.mysql_server_data["lower_case_table_names"] -- cgit v1.2.1