From 5b83bae031a9771d86933bcc808d4bf2e21216a2 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Wed, 30 Oct 2019 22:17:26 -0400 Subject: [PATCH] Refs #23576 -- Disabled MySQL multi-alias deletion path on MariaDB >= 10.3.2. --- django/db/backends/mysql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/mysql/compiler.py b/django/db/backends/mysql/compiler.py index 96232aff51..3682d6da05 100644 --- a/django/db/backends/mysql/compiler.py +++ b/django/db/backends/mysql/compiler.py @@ -15,7 +15,7 @@ class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler): class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler): def as_sql(self): - if self.single_alias: + if self.connection.features.update_can_self_select or self.single_alias: return super().as_sql() # MySQL and MariaDB < 10.3.2 doesn't support deletion with a subquery # which is what the default implementation of SQLDeleteCompiler uses