summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/features.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2022-11-05 12:41:56 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-11-07 11:36:05 +0100
commit041551d716b69ee7c81199eee86a2d10a72e15ab (patch)
tree2f76771cb42545f6ce2da513a35b8fb6fe679cfb /django/db/backends/mysql/features.py
parent967f8750ab63f9ca74ce63ada580ccc5b10b3f3b (diff)
downloaddjango-041551d716b69ee7c81199eee86a2d10a72e15ab.tar.gz
Fixed #31331 -- Switched MySQL to group by selected primary keys.
MySQL 5.7.15 supports group by functional dependences so there is no need to special case group by main table primary key anymore and special case the ONLY_FULL_GROUP_BY sql mode.
Diffstat (limited to 'django/db/backends/mysql/features.py')
-rw-r--r--django/db/backends/mysql/features.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py
index f2e4e1f1f4..471853b1a3 100644
--- a/django/db/backends/mysql/features.py
+++ b/django/db/backends/mysql/features.py
@@ -6,7 +6,7 @@ from django.utils.functional import cached_property
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
- allows_group_by_pk = True
+ allows_group_by_selected_pks = True
related_fields_match_type = True
# MySQL doesn't support sliced subqueries with IN/ALL/ANY/SOME.
allow_sliced_subqueries_with_in = False
@@ -109,18 +109,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
"update.tests.AdvancedTests.test_update_ordered_by_m2m_annotation",
},
}
- if "ONLY_FULL_GROUP_BY" in self.connection.sql_mode:
- skips.update(
- {
- "GROUP BY optimization does not work properly when "
- "ONLY_FULL_GROUP_BY mode is enabled on MySQL, see #31331.": {
- "aggregation.tests.AggregateTestCase."
- "test_aggregation_subquery_annotation_multivalued",
- "annotations.tests.NonAggregateAnnotationTestCase."
- "test_annotation_aggregate_with_m2o",
- },
- }
- )
if self.connection.mysql_is_mariadb and (
10,
4,