From e9c748a7bf1acb1423efa92ad797e9a0fbcf1cbb Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 25 Aug 2013 17:37:59 -0400 Subject: - ensure rowcount is returned for an UPDATE with no implicit returning - modernize test for that - use py3k compatible next() in test_returning/test_versioning --- lib/sqlalchemy/engine/base.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy/engine/base.py') diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 257eaa18a..735113a26 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -898,11 +898,10 @@ class Connection(Connectable): elif not context._is_explicit_returning: result.close(_autoclose_connection=False) result._metadata = None - elif context.isupdate: - if context._is_implicit_returning: - context._fetch_implicit_update_returning(result) - result.close(_autoclose_connection=False) - result._metadata = None + elif context.isupdate and context._is_implicit_returning: + context._fetch_implicit_update_returning(result) + result.close(_autoclose_connection=False) + result._metadata = None elif result._metadata is None: # no results, get rowcount -- cgit v1.2.1