summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-06-19 12:24:09 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-06-19 12:24:09 -0400
commit9f4149766c9355b303b669e0bbe4e635dd291ace (patch)
treeab27780655364c6d6b448bc3e82c79bda33cfd31 /lib/sqlalchemy/orm/util.py
parent3d78705cf4981e460d6d1b5bb08870286fc3fe93 (diff)
downloadsqlalchemy-9f4149766c9355b303b669e0bbe4e635dd291ace.tar.gz
- Fixed 1.0 regression where the enhanced behavior of single-inheritance
joins of :ticket:`3222` takes place inappropriately for a JOIN along explicit join criteria with a single-inheritance subclass that does not make use of any discriminator, resulting in an additional "AND NULL" clause. fixes #3462
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r--lib/sqlalchemy/orm/util.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index 823b97239..66cb2a319 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -839,9 +839,10 @@ class _ORMJoin(expression.Join):
# or implicit ON clause, augment it the same way we'd augment the
# WHERE.
single_crit = right_info.mapper._single_table_criterion
- if right_info.is_aliased_class:
- single_crit = right_info._adapter.traverse(single_crit)
- self.onclause = self.onclause & single_crit
+ if single_crit is not None:
+ if right_info.is_aliased_class:
+ single_crit = right_info._adapter.traverse(single_crit)
+ self.onclause = self.onclause & single_crit
def _splice_into_center(self, other):
"""Splice a join into the center.