]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Detect no params w/ manual version_id counter and set to itself
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 22 May 2017 18:47:26 +0000 (14:47 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 22 May 2017 18:47:26 +0000 (14:47 -0400)
commit0a67c1305266ba9c4558e371fa9b193788c65bea
treed99b23444c8331a4e495fa2d56946f61c95c4ed3
parentda1bc9878b71f6f7b87e2fa7895e1631ae581609
Detect no params w/ manual version_id counter and set to itself

Fixed bug where programmatic version_id counter in conjunction with
joined table inheritance would fail if the version_id counter
were not actually incremented and no other values on the base table
were modified, as the UPDATE would have an empty SET clause.  Since
programmatic version_id where version counter is not incremented
is a documented use case, this specific condition is now detected
and the UPDATE now sets the version_id value to itself, so that
concurrency checks still take place.

Change-Id: I80e385bffeed4851cc20131cbe983c173a46f655
Fixes: #3996
doc/build/changelog/changelog_12.rst
lib/sqlalchemy/orm/persistence.py
test/orm/test_versioning.py