From 0e4c4d7efc08d04c3c0ae960428b08ada37e4a91 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 14 Dec 2015 17:24:47 -0500 Subject: - Fixed bug in :meth:`.Update.return_defaults` which would cause all insert-default holding columns not otherwise included in the SET clause (such as primary key cols) to get rendered into the RETURNING even though this is an UPDATE. - Major fixes to the :paramref:`.Mapper.eager_defaults` flag, this flag would not be honored correctly in the case that multiple UPDATE statements were to be emitted, either as part of a flush or a bulk update operation. Additionally, RETURNING would be emitted unnecessarily within update statements. fixes #3609 --- lib/sqlalchemy/sql/crud.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/crud.py b/lib/sqlalchemy/sql/crud.py index 18b96018d..c5495ccde 100644 --- a/lib/sqlalchemy/sql/crud.py +++ b/lib/sqlalchemy/sql/crud.py @@ -493,6 +493,7 @@ def _append_param_update( else: compiler.postfetch.append(c) elif implicit_return_defaults and \ + stmt._return_defaults is not True and \ c in implicit_return_defaults: compiler.returning.append(c) -- cgit v1.2.1