summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-09-17 11:38:52 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2018-09-18 17:23:32 -0400
commit43f2c66ea7413cc0aaf6ca040ad33fb65ca4412d (patch)
tree98f8e3fdd5a3bc99911beb7597e3ba5fc3366d69 /lib/sqlalchemy/sql
parent67a2cd92295bef55d914a5c560b4cead5d456837 (diff)
downloadsqlalchemy-43f2c66ea7413cc0aaf6ca040ad33fb65ca4412d.tar.gz
Adapt right side in join if lateral detected
Fixed bug where use of :class:`.Lateral` construct in conjunction with :meth:`.Query.join` as well as :meth:`.Query.select_entity_from` would not apply clause adaption to the right side of the join. "lateral" introduces the use case of the right side of a join being correlatable. Previously, adaptation of this clause wasn't considered. Fixes: #4334 Change-Id: I3631e562092769d30069a2aa5e50a580f4661a23
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/selectable.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index 5b665829b..64886b326 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -338,6 +338,8 @@ class FromClause(Selectable):
_is_select = False
_is_from_container = False
+ _is_lateral = False
+
_textual = False
"""a marker that allows us to easily distinguish a :class:`.TextAsFrom`
or similar object from other kinds of :class:`.FromClause` objects."""
@@ -1329,6 +1331,7 @@ class Lateral(Alias):
"""
__visit_name__ = 'lateral'
+ _is_lateral = True
class TableSample(Alias):
@@ -3008,7 +3011,6 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
# contents, as this set is used for matching, not rendering.
self._correlate = set(clone(f) for f in
self._correlate).union(self._correlate)
-
# 4. clone other things. The difficulty here is that Column
# objects are not actually cloned, and refer to their original
# .table, resulting in the wrong "from" parent after a clone