summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-06-09 23:39:14 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-06-09 23:39:14 -0400
commita9030d0241964c919b099e4bdb75d38fd420b546 (patch)
tree36e714c1999c6e02e40f63e975c1d6fc241de52a /lib/sqlalchemy/sql/elements.py
parent1cc50c81b9d3507e9bcefc625dd07b12a8178e9c (diff)
downloadsqlalchemy-a9030d0241964c919b099e4bdb75d38fd420b546.tar.gz
- Fixed a bug where clause adaption as applied to a :class:`.Label`
object would fail to accommodate the labeled SQL expression in all cases, such that any SQL operation that made use of :meth:`.Label.self_group` would use the original unadapted expression. One effect of this would be that an ORM :func:`.aliased` construct would not fully accommodate attributes mapped by :obj:`.column_property`, such that the un-aliased table could leak out when the property were used in some kinds of SQL comparisons. fixes #3445
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index a178ed99a..27ecce2b0 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -3103,7 +3103,8 @@ class Label(ColumnElement):
return self.element,
def _copy_internals(self, clone=_clone, anonymize_labels=False, **kw):
- self.element = clone(self.element, **kw)
+ self._element = clone(self._element, **kw)
+ self.__dict__.pop('element', None)
self.__dict__.pop('_allow_label_resolve', None)
if anonymize_labels:
self.name = self._resolve_label = _anonymous_label(