]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix issue in bulk_save_objects
authorFederico Caselli <cfederico87@gmail.com>
Sun, 28 Apr 2024 10:01:05 +0000 (12:01 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Mon, 29 Apr 2024 19:58:33 +0000 (21:58 +0200)
commit368d88d1ac29db7b5d3933e37d43aebc06ad633b
tree1fc7af899f3ddea8b1304531ac39e31f35c4d73a
parentd069f4b30bf217ea222abab0cdcf61ecea94c55d
Fix issue in bulk_save_objects

Fixes issue in :meth:`_orm.Session.bulk_save_objects()` where it would write a
wrong identity key when using ``return_defaults=True``.
The wrong identity key could lead to an index error when entities are then pickled.

Fixes: #11332
Change-Id: I8d095392ad03e8d3408e477476cd5de8a5bca2c0
(cherry picked from commit ade4bdfb0406fadff566aa8d39abe6aa29af521f)
doc/build/changelog/unreleased_20/11332.rst [new file with mode: 0644]
lib/sqlalchemy/orm/bulk_persistence.py
lib/sqlalchemy/orm/session.py
test/orm/dml/test_bulk.py
test/orm/test_pickled.py