From a52a0c43c3d4880df53c46d1fd92fcf8d1a3a758 Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Fri, 2 Jan 2009 04:54:45 +0000 Subject: [PATCH] Modified UOW so that a Row Switch scenario will not attempt to update the Primary Key. --- lib/sqlalchemy/orm/mapper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 0dc3465327..1e257f9a47 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -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: -- 2.47.3