]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Modified UOW so that a Row Switch scenario will not attempt to update the Primary...
authorMichael Trier <mtrier@gmail.com>
Fri, 2 Jan 2009 04:54:45 +0000 (04:54 +0000)
committerMichael Trier <mtrier@gmail.com>
Fri, 2 Jan 2009 04:54:45 +0000 (04:54 +0000)
lib/sqlalchemy/orm/mapper.py

index 0dc3465327a87a23339814c287aa0ba210b40b1a..1e257f9a471e44f86131384474873369f30af7c3 100644 (file)
@@ -1318,6 +1318,9 @@ class Mapper(object):
                                         params[col._label] = prop.get_col_value(col, history.deleted[0])
                                     else:
                                         # row switch logic can reach us here
+                                        # remove the pk from the update params so the update doesn't
+                                        # attempt to include the pk in the update statement
+                                        del params[col.key]
                                         params[col._label] = prop.get_col_value(col, history.added[0])
                                 hasdata = True
                             elif col in pks: