]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
refine ruleset to determine when poly adaption should be used
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 29 Aug 2022 14:43:36 +0000 (10:43 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 30 Aug 2022 03:43:47 +0000 (23:43 -0400)
commitc1d6e807730b9a0ed2d9a0436aeae43cc0cf47f4
tree969f8db04c7846c6fae30ca9ee546f9f148580f4
parentef65749704796130768c31dec37064d70e6695e7
refine ruleset to determine when poly adaption should be used

Fixed regression appearing in the 1.4 series where a joined-inheritance
query placed as a subquery within an enclosing query for that same entity
would fail to render the JOIN correctly for the inner query. The issue
manifested in two different ways prior and subsequent to version 1.4.18
(related issue #6595), in one case rendering JOIN twice, in the other
losing the JOIN entirely. To resolve, the conditions under which
"polymorphic loading" are applied have been scaled back to not be invoked
for simple joined inheritance queries.

Fixes: #8456
Change-Id: Ie4332fadb1dfc670cd31d098a6586a9f6976bcf7
(cherry picked from commit 137b50e1ecf1ddea1ff63d94f24f6445e6807dc9)
doc/build/changelog/unreleased_14/8456.rst [new file with mode: 0644]
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/strategies.py
test/orm/inheritance/test_concrete.py
test/orm/inheritance/test_polymorphic_rel.py