1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #30572 -- Prevented values()/values_list() on combined queryset from mutating the list of columns in querysets.

This commit is contained in:
Mariusz Felisiak
2019-06-19 10:44:53 +02:00
committed by GitHub
parent a7038adbd0
commit 14d026cccb
2 changed files with 4 additions and 0 deletions

View File

@@ -426,6 +426,7 @@ class SQLCompiler:
# must have the same columns list. Set the selects defined on
# the query on all combined queries, if not already set.
if not compiler.query.values_select and self.query.values_select:
compiler.query = compiler.query.clone()
compiler.query.set_values((
*self.query.extra_select,
*self.query.values_select,