]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Use attr keys when testing bulk update params for primary key
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 2 Nov 2018 01:53:18 +0000 (21:53 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 2 Nov 2018 01:54:10 +0000 (21:54 -0400)
commite991684a39fa9fae2628ce583e141b9aea99d856
treeb2f95b51158ee030c985dd8e6532d10f7e6e0f3e
parent7d372da7385be6a9817a20b6b62f7c4237af7b26
Use attr keys when testing bulk update params for primary key

Fixed bug in :meth:`.Session.bulk_update_mappings` where alternate mapped
attribute names would result in the primary key column of the UPDATE
statement being included in the SET clause, as well as the WHERE clause;
while usually harmless, for SQL Server this can raise an error due to the
IDENTITY column.  This is a continuation of the same bug that was fixed in
:ticket:`.3849`, where testing was insufficient to catch this additional
flaw.

Fixes: #4357
Change-Id: Iead058c0465dfa31c5b8a8780769278b7000acc8
doc/build/changelog/unreleased_12/4357.rst [new file with mode: 0644]
lib/sqlalchemy/orm/persistence.py
test/orm/test_bulk.py