summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-11 20:04:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-11 20:04:57 -0400
commitce5cff151ad5f4d807c2655f7e44c3245552c0b6 (patch)
tree330f584b70ffbeeda39e30d6fdbe566f94d4f95d /lib/sqlalchemy/orm/mapper.py
parentb19f3db87085b96e843169252d5c7e2c2d8c428b (diff)
downloadsqlalchemy-ce5cff151ad5f4d807c2655f7e44c3245552c0b6.tar.gz
Fixed bug whereby ORM would run the wrong kind of
query when refreshing an inheritance-mapped class where the superclass was mapped to a non-Table object, like a custom join() or a select(), running a query that assumed a hierarchy that's mapped to individual Table-per-class. [ticket:2697]
Diffstat (limited to 'lib/sqlalchemy/orm/mapper.py')
-rw-r--r--lib/sqlalchemy/orm/mapper.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index d258a20b6..914c29b7f 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -1933,6 +1933,8 @@ class Mapper(_InspectionAttr):
for mapper in reversed(list(self.iterate_to_root())):
if mapper.local_table in tables:
start = True
+ elif not isinstance(mapper.local_table, expression.TableClause):
+ return None
if start and not mapper.single:
allconds.append(visitors.cloned_traverse(
mapper.inherit_condition,