summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-06-07 23:04:33 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-06-07 23:04:33 -0400
commitd5363fca5400f6c4969c2756fcfcdae6b9703091 (patch)
tree2893e5faa72e8606f4664ab7efee9d346586e37f /lib/sqlalchemy/sql/util.py
parent0d9ec9fe840eb71935c2a55c3063620a028e59aa (diff)
downloadsqlalchemy-d5363fca5400f6c4969c2756fcfcdae6b9703091.tar.gz
- Fixed an obscure bug where the wrong results would be
fetched when joining/joinedloading across a many-to-many relationship to a single-table-inheriting subclass with a specific discriminator value, due to "secondary" rows that would come back. The "secondary" and right-side tables are now inner joined inside of parenthesis for all ORM joins on many-to-many relationships so that the left->right join can accurately filtered. [ticket:2369]
Diffstat (limited to 'lib/sqlalchemy/sql/util.py')
-rw-r--r--lib/sqlalchemy/sql/util.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index 4422705cd..bf3f3397e 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -213,6 +213,8 @@ def surface_selectables(clause):
yield elem
if isinstance(elem, expression.Join):
stack.extend((elem.left, elem.right))
+ elif isinstance(elem, expression.FromGrouping):
+ stack.append(elem.element)
def selectables_overlap(left, right):
"""Return True if left/right have some overlapping selectable"""