From 14d026cccb144c6877294ba4cd4e03ebf0842498 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 19 Jun 2019 10:44:53 +0200 Subject: Fixed #30572 -- Prevented values()/values_list() on combined queryset from mutating the list of columns in querysets. --- django/db/models/sql/compiler.py | 1 + 1 file changed, 1 insertion(+) (limited to 'django/db/models/sql') diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index a44adfc760..a791908caf 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -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, -- cgit v1.3