]> 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:56:58 +0000 (21:56 +0200)
commitade4bdfb0406fadff566aa8d39abe6aa29af521f
tree2f1e30e7f3155c17485861942a811efb22c03def
parentd85289b35ee6c2683eef378f1ea2fdea7f401ed9
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
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