]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Alias the onclause if ORM join is to same polymorphic selectable
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Apr 2020 20:51:43 +0000 (16:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Apr 2020 22:39:11 +0000 (18:39 -0400)
commitb72c14cde21abbc4a8cea9089853c4f34ed2e364
tree5d6e063b72e361ed95ab100422ca66fc24f08c58
parent62edc4023e189836a5ba490c2dbb835827486b0b
Alias the onclause if ORM join is to same polymorphic selectable

Fixed bug where using :func:`.with_polymorphic` as the target of a join via
:meth:`.RelationshipComparator.of_type` on a mapper that already has a
subquery-based with_polymorphic setting that's equivalent to the one
requested would not correctly alias the ON clause in the join.

Fixes: #5288
Change-Id: I0212a990ee67a344c87fe21833bf47fdb72ca0cc
(cherry picked from commit 483a644959f396e3abdcb8f0f373936569958970)
doc/build/changelog/unreleased_13/5288.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/relationships.py
test/orm/inheritance/_poly_fixtures.py
test/orm/inheritance/test_polymorphic_rel.py