From 009acc95b8804b5b62fbd43c6fdd61d6fd407ef7 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 15 Jun 2019 18:06:50 -0400 Subject: Turn off the is_literal flag when proxying literal_column() to Label Fixed a series of quoting issues which all stemmed from the concept of the :func:`.literal_column` construct, which when being "proxied" through a subquery to be referred towards by a label that matches its text, the label would not have quoting rules applied to it, even if the string in the :class:`.Label` were set up as a :class:`.quoted_name` construct. Not applying quoting to the text of the :class:`.Label` is a bug because this text is strictly a SQL identifier name and not a SQL expression, and the string should not have quotes embedded into it already unlike the :func:`.literal_column` which it may be applied towards. The existing behavior of a non-labeled :func:`.literal_column` being propagated as is on the outside of a subquery is maintained in order to help with manual quoting schemes, although it's not clear if valid SQL can be generated for such a construct in any case. Fixes: #4730 Change-Id: I300941f27872fc4298c74a1d1ed65aef1a5cdd82 --- lib/sqlalchemy/sql/selectable.py | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/sqlalchemy/sql/selectable.py') diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index 014c782d0..fbc33ea9b 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -3842,7 +3842,6 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect): key = c.anon_label else: key = None - c._make_proxy(self, key=key, name=name, name_is_truncatable=True) def _refresh_for_new_column(self, column): -- cgit v1.2.1