mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[3.1.x] Fixed #31624 -- Avoided subquery usage on QuerySet.all().delete().
Thanks Adam Johnson for the report. Regression in7acef095d7. Backport of972000420efrom master
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							6e3c543909
						
					
				
				
					commit
					d91095def4
				
			| @@ -605,6 +605,12 @@ class DeletionTests(TestCase): | ||||
|  | ||||
|  | ||||
| class FastDeleteTests(TestCase): | ||||
|     def test_fast_delete_all(self): | ||||
|         with self.assertNumQueries(1) as ctx: | ||||
|             User.objects.all().delete() | ||||
|         sql = ctx.captured_queries[0]['sql'] | ||||
|         # No subqueries is used when performing a full delete. | ||||
|         self.assertNotIn('SELECT', sql) | ||||
|  | ||||
|     def test_fast_delete_fk(self): | ||||
|         u = User.objects.create( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user