]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
ResultProxy won't autoclose connection until state flag is set
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 3 Apr 2017 21:25:26 +0000 (17:25 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 4 Apr 2017 01:12:39 +0000 (21:12 -0400)
commitf52fb5282a046d26b6ee2778e03b995eb117c2ee
tree12a4047a99f96a03eae21977701cd59e6de3356a
parent2281ac7f1c6494f01621b4b3aa4db5f5d8e9d789
ResultProxy won't autoclose connection until state flag is set

Changed the mechanics of :class:`.ResultProxy` to unconditionally
delay the "autoclose" step until the :class:`.Connection` is done
with the object; in the case where Postgresql ON CONFLICT with
RETURNING returns no rows, autoclose was occurring in this previously
non-existent use case, causing the usual autocommit behavior that
occurs unconditionally upon INSERT/UPDATE/DELETE to fail.

Change-Id: I235a25daf4381b31f523331f810ea04450349722
Fixes: #3955
(cherry picked from commit 8ee363e4917b0dcd64a83b6d26e465c9e61e0ea5)
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/result.py
test/dialect/postgresql/test_on_conflict.py
test/sql/test_resultset.py