]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
match ORM mapped cols to PK in interpret_returning_rows
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 14 Oct 2024 15:15:21 +0000 (11:15 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 15 Oct 2024 15:43:09 +0000 (11:43 -0400)
commit601e85b8d9b3cb6d85803b3989c79a8c10e4d7a0
tree8005cbce19d07f5a46d124a02dbda7e5f43b7011
parent25a316daa5b54c6b5bdd2c1b092c17444a4d2af4
match ORM mapped cols to PK in interpret_returning_rows

Fixed bug in ORM "update with WHERE clause" feature where an explicit
``.returning()`` would interfere with the "fetch" synchronize strategy due
to an assumption that the ORM mapped class featured the primary key columns
in a specific position within the RETURNING.  This has been fixed to use
appropriate ORM column targeting.

the _interpret_returning_rows method looked to be mostly not used as far
as its joined inheritance features, which appear to have never been
used as joined inheritance mappers are skipped.

Fixes: #11997
Change-Id: I38fe3a84cdeb2eef38fe00d8b9a6a2b56f434bc6
(cherry picked from commit 553d02b30eba13f3db4595d7a15e51222f864e13)
doc/build/changelog/unreleased_20/11997.rst [new file with mode: 0644]
lib/sqlalchemy/orm/bulk_persistence.py
test/orm/dml/test_update_delete_where.py