mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[5.0.x] Fixed #34978, Refs #31331 -- Added backward incompatibility note about raw aggregations on MySQL.
Thanks Matthew Somerville for the report.
Backport of a652f07596 from main
			
			
This commit is contained in:
		
				
					committed by
					
						 Natalia
						Natalia
					
				
			
			
				
	
			
			
			
						parent
						
							d9ba8fa397
						
					
				
				
					commit
					cbd1e913ef
				
			| @@ -409,6 +409,16 @@ fields modified in the custom ``save()`` methods should be added to the | ||||
| ``update_fields`` keyword argument before calling ``super()``. See | ||||
| :ref:`overriding-model-methods` for more details. | ||||
|  | ||||
| Dropped support for raw aggregations on MySQL | ||||
| --------------------------------------------- | ||||
|  | ||||
| MySQL 8+ allows functional dependencies on ``GROUP BY`` columns, so the | ||||
| pre-Django 4.2 workaround of grouping by primary keys of the main table is | ||||
| removed. As a consequence, using ``RawSQL()`` aggregations is no longer | ||||
| supported on MySQL as there is no way to determine if such aggregations are | ||||
| needed or valid in the ``GROUP BY`` clause. Use :ref:`aggregation-functions` | ||||
| instead. | ||||
|  | ||||
| Miscellaneous | ||||
| ------------- | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user