]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Deannotate "parententity" in primaryjoin/secondaryjoin
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 14 Nov 2018 16:31:22 +0000 (11:31 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 14 Nov 2018 16:37:20 +0000 (11:37 -0500)
commitd096e930f99d0f6ed1462173041bb57143cad225
tree732749e687fee2b0cd437adfb1f2ea8026cafa70
parent6726c60e4cff0d1f157c2fab1b2a79ad2d2182a4
Deannotate "parententity" in primaryjoin/secondaryjoin

Fixed bug where the ORM annotations could be incorrect for the
primaryjoin/secondaryjoin a relationship if one used the pattern
``ForeignKey(SomeClass.id)`` in the declarative mappings.   This pattern
would leak undesired annotations into the join conditions which can break
aliasing operations done within :class:`.Query` that are not supposed to
impact elements in that join condition.  These annotations are now removed
up front if present.

Also add a test suite for has/any into test_query which will
form the basis for new tests to be added in :ticket:`4366`.

Fixes: #4367
Change-Id: I929ef983981bb49bf975f346950ebb0e19c986b8
(cherry picked from commit 4ee5b2c4a9e7ad9f3df75940b9837d5c65cba6fd)
doc/build/changelog/unreleased_12/4367.rst [new file with mode: 0644]
lib/sqlalchemy/orm/relationships.py
test/orm/test_query.py
test/orm/test_rel_fn.py