]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure ORMInsert sets up bind state
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Apr 2022 16:01:16 +0000 (12:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Apr 2022 16:01:16 +0000 (12:01 -0400)
commit4f96c12db923624204110e56ce730f5aafbb9463
treedff198806942969feb4ea491256704985c5b0210
parent3d300066e8b20a89e0b82bf09dd0c4016f5f8e51
Ensure ORMInsert sets up bind state

Fixed regression where the change in #7861, released in version 1.4.33,
that brought the :class:`.Insert` construct to be partially recognized as
an ORM-enabled statement did not properly transfer the correct mapper /
mapped table state to the :class:`.Session`, causing the
:meth:`.Session.get_bind` method to fail for a :class:`.Session` that was
bound to engines and/or connections using the :paramref:`.Session.binds`
parameter.

Fixes: #7936
Change-Id: If19edef8e2dd68335465429eb3d2f0bfdade4a4c
doc/build/changelog/unreleased_14/7936.rst [new file with mode: 0644]
lib/sqlalchemy/orm/persistence.py
test/orm/test_bind.py
test/orm/test_update_delete.py