]> 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)
committerMichael Bayer <mike_mp@zzzcomputing.com>
Wed, 20 May 2026 19:26:16 +0000 (19:26 +0000)
commit4ce719fbb3889765b43d7005954b4a8ae7de8c93
tree955bec4991fefe0388844a4e951617a4a0d91e3f
parent56edb237cb652bed221a377cdc2ae2b7b835dd61
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
doc/build/changelog/unreleased_20/13203.rst [new file with mode: 0644]
lib/sqlalchemy/orm/relationships.py
test/orm/test_relationship_criteria.py