summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-05-03 07:58:42 +0200
committerGitHub <noreply@github.com>2023-05-03 07:58:42 +0200
commit83339d2103f447377fedb3bd145b52c3ef2b667c (patch)
treedc079f7afbd811587ffd9e42073a92d09f20d9e3 /django
parentea53e7c09f1b8864c20c65976bbeaeab77abdaec (diff)
downloaddjango-83339d2103f447377fedb3bd145b52c3ef2b667c.tar.gz
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.
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/mysql/features.py3
1 files changed, 0 insertions, 3 deletions
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"]