]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure select_from_entity adapter is used in adjust_for_single_inheritance
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 19 Apr 2018 21:07:32 +0000 (17:07 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 19 Apr 2018 21:12:09 +0000 (17:12 -0400)
commitc34a856b51785d1399ef97e356f791f1eb93d2d5
tree9c93231c55298bf3bb8d20305511a946bc1e05d6
parent79a2d375ddf410c56a0dec2935adbb5196c27d52
Ensure select_from_entity adapter is used in adjust_for_single_inheritance

Fixed issue in single-inheritance loading where the use of an aliased
entity against a single-inheritance subclass in conjunction with the
:meth:`.Query.select_from` method would cause the SQL to be rendered with
the unaliased table mixed in to the query, causing a cartesian product.  In
particular this was affecting the new "selectin" loader when used against a
single-inheritance subclass.

Change-Id: Ic2cbe94a5269c101b1f98da9a466180dd4452783
Fixes: #4241
(cherry picked from commit 4f2d0913fe4fe4f5182f85903a6b3be65ac4fd94)
doc/build/changelog/unreleased_12/4241.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
test/orm/inheritance/test_single.py
test/orm/test_selectin_relations.py