]> 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 16:01:18 +0000 (12:01 -0400)
commit066c25ba892787cdac448e82ac77daf9174310f1
tree374d6f1e5f560035768db581eb7a8dcb94f35454
parentedbf208afd123fe0b63e6f3808cbdf1650008aaf
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
(cherry picked from commit 1b5393db36a6c4353d41c7065b29a377d7c3b9b2)
doc/build/changelog/unreleased_12/4327.rst [new file with mode: 0644]
lib/sqlalchemy/orm/persistence.py
test/orm/test_cycles.py