diff options
| author | Simon Charette <charette.s@gmail.com> | 2015-12-13 23:46:41 -0500 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2015-12-14 13:12:36 -0500 |
| commit | 8035cee92293f3319919c8248c7787ba43c05917 (patch) | |
| tree | 1d210cccd6ea810ecc1854b33785ce7141ca28b0 /tests/delete/tests.py | |
| parent | 5233b70070f8979f41ca1da2c1b1d78c8e30944e (diff) | |
Fixed #25882 -- Prevented fast deletes matching no rows from crashing on MySQL.
Thanks to Trac aliases gerricom for the report, raphaelmerx for the
attempts to reproduce and Sergey Fedoseev and Tim for the review.
Refs #16891
Diffstat (limited to 'tests/delete/tests.py')
| -rw-r--r-- | tests/delete/tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/delete/tests.py b/tests/delete/tests.py index 663a22791b..1a8941904c 100644 --- a/tests/delete/tests.py +++ b/tests/delete/tests.py @@ -503,3 +503,15 @@ class FastDeleteTests(TestCase): # that + fast delete of the related objs. self.assertNumQueries(2, a.delete) self.assertEqual(User.objects.count(), 0) + + def test_fast_delete_empty_no_update_can_self_select(self): + """ + #25932 - Fast deleting on backends that don't have the + `no_update_can_self_select` feature should work even if the specified + filter doesn't match any row. + """ + with self.assertNumQueries(1): + self.assertEqual( + User.objects.filter(avatar__desc='missing').delete(), + (0, {'delete.User': 0}) + ) |
