From 7acef095d73322f45dcceb99afa1a4e50b520479 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Thu, 17 Oct 2019 01:57:39 -0400 Subject: Fixed #23576 -- Implemented multi-alias fast-path deletion in MySQL backend. This required moving the entirety of DELETE SQL generation to the compiler where it should have been in the first place and implementing a specialized compiler on MySQL/MariaDB. The MySQL compiler relies on the "DELETE table FROM table JOIN" syntax for queries spanning over multiple tables. --- tests/delete/tests.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/delete/tests.py b/tests/delete/tests.py index 8cb028344b..d61fdb40c1 100644 --- a/tests/delete/tests.py +++ b/tests/delete/tests.py @@ -535,9 +535,7 @@ class FastDeleteTests(TestCase): a = Avatar.objects.create(desc='a') User.objects.create(avatar=a) u2 = User.objects.create() - expected_queries = 1 if connection.features.update_can_self_select else 2 - self.assertNumQueries(expected_queries, - User.objects.filter(avatar__desc='a').delete) + self.assertNumQueries(1, User.objects.filter(avatar__desc='a').delete) self.assertEqual(User.objects.count(), 1) self.assertTrue(User.objects.filter(pk=u2.pk).exists()) -- cgit v1.3