]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Don't run postfetch_post_update for a DELETE
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 23 Aug 2018 15:55:13 +0000 (11:55 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 23 Aug 2018 15:55:13 +0000 (11:55 -0400)
commit1b5393db36a6c4353d41c7065b29a377d7c3b9b2
treefe26ff0d105e616253038c733ab2737e7f7fc54c
parent469931514a1517dde82ba56f780c3007c66d5943
Don't run postfetch_post_update for a DELETE

Fixed 1.2 regression caused by :ticket:`3472` where the handling of an
"updated_at" style column within the context of a post-update operation
would also occur for a row that is to be deleted following the update,
meaning both that a column with a Python-side value generator would show
the now-deleted value that was emitted for the UPDATE before the DELETE
(which was not the previous behavor), as well as that a SQL- emitted value
generator would have the attribute expired, meaning the previous value
would be unreachable due to the row having been deleted and the object
detached from the session.The "postfetch" logic that was added as part of
:ticket:`3472` is now skipped entirely for an object that ultimately is to
be deleted.

Fixes: #4327
Change-Id: Ieac845348979df296bcf7e785c0353bdc6074220
doc/build/changelog/unreleased_12/4327.rst [new file with mode: 0644]
lib/sqlalchemy/orm/persistence.py
test/orm/test_cycles.py