]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix joinedload + of_type() + and_() invalid SQL for subclass columns
authorJoaquin Hui Gomez <132194176+joaquinhuigomez@users.noreply.github.com>
Wed, 1 Apr 2026 17:29:38 +0000 (13:29 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 20 May 2026 19:29:48 +0000 (15:29 -0400)
commit1623a5e1ee6c1c8a19dade0eb18e4a99b57b5654
treeaabd288c3cc3150b5e8ea6346dfd451fcafc07cb
parente50452cea3c2fae7bb9aed29d6533448155ea4d3
Fix joinedload + of_type() + and_() invalid SQL for subclass columns

Fixed issue where using :func:`_orm.joinedload` with
:meth:`.PropComparator.of_type` targeting a joined-table subclass combined
with :meth:`.PropComparator.and_` referencing a column on that subclass
would generate invalid SQL, where the subclass column was not adapted to
the subquery alias.  Pull request courtesy Joaquin Hui Gomez.

Fixes #13203

Closes: #13206
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13206
Pull-request-sha: ba55b0c3e2a8dae28a1c7d7ae646e3480a04425c

Change-Id: I78fe4672649d1d5498e3bc653e5d943ccb55dafd
(cherry picked from commit e04e4b2b58ef9581b3a5e4129e719b0b707b446a)
doc/build/changelog/unreleased_20/13203.rst [new file with mode: 0644]
lib/sqlalchemy/orm/relationships.py
test/orm/test_relationship_criteria.py