summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-11-05 10:18:47 +0100
committerGitHub <noreply@github.com>2019-11-05 10:18:47 +0100
commita20ea33ca66bafd38bfce1a73221384b8aa37170 (patch)
tree37c25fb91150b2896dad02b81f3c4e237f869d91
parentb9fe7f9294b1b4fc974c008adeb96e1375cdb0c6 (diff)
Fixed DatabaseFeatures.has_select_for_update_nowait on MariaDB 10.3+.
Thanks Kola Erinoso for the report.
-rw-r--r--django/db/backends/mysql/features.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py
index 9aaae2b5da..1d0cd365db 100644
--- a/django/db/backends/mysql/features.py
+++ b/django/db/backends/mysql/features.py
@@ -111,7 +111,11 @@ class DatabaseFeatures(BaseDatabaseFeatures):
def has_select_for_update_skip_locked(self):
return not self.connection.mysql_is_mariadb and self.connection.mysql_version >= (8, 0, 1)
- has_select_for_update_nowait = property(operator.attrgetter('has_select_for_update_skip_locked'))
+ @cached_property
+ def has_select_for_update_nowait(self):
+ if self.connection.mysql_is_mariadb:
+ return self.connection.mysql_version >= (10, 3, 0)
+ return self.connection.mysql_version >= (8, 0, 1)
@cached_property
def needs_explain_extended(self):