]> 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:02:19 +0000 (12:02 -0400)
commit93401c5f262b22f2ce729a04202ca559f4593976
tree91606a026e69384820cda1f5aeb6273f0c53bb04
parent0c0bcd95ce843d8541ae952ec5262851d109ab0a
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
(cherry picked from commit 4f96c12db923624204110e56ce730f5aafbb9463)
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