]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Cancel polymorphic loading in optimized get
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 1 Oct 2019 01:26:08 +0000 (21:26 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 1 Oct 2019 20:11:34 +0000 (16:11 -0400)
commit9a2a0f324c13b5a1b334a3982a766cb9f21f428e
treef4548faa2cf60f07d2e13e6eb1b137ff1d3e072d
parenta3c964203e61f8deeb559b15a78cc640dee67012
Cancel polymorphic loading in optimized get

Since optimized_get for inheriting mappers writes a simple
SELECT, we need to cancel out any with_polymorphic selectables
that interfere with simple column lookup.  While adaptation is
another option, just removing the with_polymorphic is much
simpler.   The issue is not noticeable unless the ResultProxy
is not allowing "key fallback" column lookups, which will
be the case when this behavior is deprecated.

Fixes: #4718
Change-Id: I8fa2f5c0434b6a681813a92ac71fe12712f5d634
doc/build/changelog/unreleased_14/4718.rst [new file with mode: 0644]
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/sql/util.py
test/orm/inheritance/test_basic.py