summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-11-09 15:02:44 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-11-09 15:25:38 -0500
commit89661c1a218b7117c1835698dbb81836e72015ae (patch)
tree1101261abdcbae5795f85e4f2a115b7fec9f4479 /lib/sqlalchemy/sql/compiler.py
parent8b1d59a95479802b5d568999e751f637ac310879 (diff)
downloadsqlalchemy-89661c1a218b7117c1835698dbb81836e72015ae.tar.gz
set within_columns_clause=False for all sub-elements of select()
Fixed issue where using the feature of using a string label for ordering or grouping described at :ref:`tutorial_order_by_label` would fail to function correctly if used on a :class:`.CTE` construct, when the CTE were embedded inside of an enclosing :class:`_sql.Select` statement that itself was set up as a scalar subquery. Fixes: #7269 Change-Id: Ied6048a1c9a622374a418230c8cfedafa8d3f87e
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 646b49f22..a2c4f9512 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -3216,6 +3216,9 @@ class SQLCompiler(Compiled):
# passed in. for ORM use this will convert from an ORM-state
# SELECT to a regular "Core" SELECT. other composed operations
# such as computation of joins will be performed.
+
+ kwargs["within_columns_clause"] = False
+
compile_state = select_stmt._compile_state_factory(
select_stmt, self, **kwargs
)