]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Don't mutate old collection on bulk replace
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 14 Feb 2017 16:39:44 +0000 (11:39 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 15 Mar 2017 21:22:59 +0000 (17:22 -0400)
commit2bfe19152d49b969acdc4607bf7c33727f796f5a
tree0f71aa7ac14459bb03f1b6ced1c66741d90a9232
parentb5b6e9574854fd9784d7c26e2c585a3ff5ae4cb6
Don't mutate old collection on bulk replace

For a bulk replace, assume the old collection is no longer
useful to the attribute system and only send the removal events,
not actually mutated the collection.

this changes behavior significantly and also means that dispose_collection
now receives the old collection intact.

Change-Id: Ic2685c85438191f07797d9ef97833a2cfdc4fcc2
Fixes: #3913
doc/build/changelog/changelog_12.rst
doc/build/changelog/migration_12.rst
lib/sqlalchemy/orm/collections.py
lib/sqlalchemy/orm/events.py
test/orm/test_attributes.py
test/orm/test_collection.py