]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
include empty intermediary tables in optimized get
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 26 Dec 2021 17:13:19 +0000 (12:13 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 26 Dec 2021 20:01:13 +0000 (15:01 -0500)
commit5ed850b58c679f87edb218c24c2403a3e787f637
tree82669612e4235153684dd961dba96a1a55cf4ab1
parent6cdb3331c6a3331faf74f134ec0d04c7f217c454
include empty intermediary tables in optimized get

Fixed issue in joined-inheritance load of additional attributes
functionality in deep multi-level inheritance where an intermediary table
that contained no columns would not be included in the tables joined,
instead linking those tables to their primary key identifiers. While this
works fine, it nonetheless in 1.4 began producing the cartesian product
compiler warning. The logic has been changed so that these intermediary
tables are included regardless. While this does include additional tables
in the query that are not technically necessary, this only occurs for the
highly unusual case of deep 3+ level inheritance with intermediary tables
that have no non primary key columns, potential performance impact is
therefore expected to be negligible.

Fixes: #7507
Change-Id: Id2073773e97a0853b744b51feeb2bc4437032e51
(cherry picked from commit c1d2fbac4c399b47f4715f7ea2a1147374d2aa43)
doc/build/changelog/unreleased_14/7507.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
test/orm/inheritance/test_basic.py