]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
apply correct pre-fetch params to post updated rows
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 5 Aug 2025 21:11:50 +0000 (17:11 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 5 Aug 2025 21:11:50 +0000 (17:11 -0400)
commitf4d9c107554288318003437103a3ac3e2d0bbb51
tree8f413d9be9f83658c65197144adfa8d99f57695a
parent9dd5983f4d27c708d5ce6544bfb8b65f5a696358
apply correct pre-fetch params to post updated rows

Fixed issue where using the ``post_update`` feature would apply incorrect
"pre-fetched" values to the ORM objects after a multi-row UPDATE process
completed.  These "pre-fetched" values would come from any column that had
an :paramref:`.Column.onupdate` callable or a version id generator used by
:paramref:`.orm.Mapper.version_id_generator`; for a version id generator
that delivered random identifiers like timestamps or UUIDs, this incorrect
data would lead to a DELETE statement against those same rows to fail in
the next step.

Fixes: #12748
Change-Id: Id12c7973f168604533762dfc01afbb9155b693a6
doc/build/changelog/unreleased_20/12748.rst [new file with mode: 0644]
lib/sqlalchemy/orm/persistence.py
test/orm/test_cycles.py
test/orm/test_versioning.py