]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Check collection less than two items remaining before firing scalar backref remove
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 23 Dec 2018 00:16:50 +0000 (19:16 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 28 Dec 2018 13:40:44 +0000 (08:40 -0500)
commit847d1359421ebb3b4ba653ca1a9d238e62e8e8a8
tree88f7ab56680d37ae1cdf32d2d8cb9d6b0126da67
parent07cea66ccb74c68fa505b5fbba91984e0375993d
Check collection less than two items remaining before firing scalar backref remove

Fixed long-standing issue where duplicate collection members would cause a
backref to delete the association between the member and its parent object
when one of the duplicates were removed, as occurs as a side effect of
swapping two objects in one statement.

Fixes: #1103
Change-Id: Ic12877f7bd5a4eb688091725a78410748e7fdf16
doc/build/changelog/migration_13.rst
doc/build/changelog/unreleased_13/1103.rst [new file with mode: 0644]
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/_collections.py
test/orm/test_backref_mutations.py
test/profiles.txt