From fc15d11f2eb26fe3d5c946e69223880bfe53e92b Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Sun, 26 Feb 2023 13:43:00 +0100 Subject: [4.2.x] Fixed #34368 -- Made subquery raise NotSupportedError when referencing outer window expression. Regression in f387d024fc75569d2a4a338bfda76cc2f328f627. Co-authored-by: Jannis Vajen Backport of c67ea79aa981ae82595d89f8018a41fcd842e7c9 from main --- django/db/models/sql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/models/sql/compiler.py') diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 1faed5c416..1c16217ae7 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -676,7 +676,7 @@ class SQLCompiler: ) ) inner_query_compiler = inner_query.get_compiler( - self.using, elide_empty=self.elide_empty + self.using, connection=self.connection, elide_empty=self.elide_empty ) inner_sql, inner_params = inner_query_compiler.as_sql( # The limits must be applied to the outer query to avoid pruning -- cgit v1.3