summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-01-13 06:11:17 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-01-13 06:11:17 +0000
commitb23f8c0f2efea544954e1f6cfcdf4931b2f57213 (patch)
treeb2e73ac4a609846197e97580abf249da7f528cbb /lib/sqlalchemy
parent313762e86f889c45e35a5c81cef67941c517321d (diff)
downloadsqlalchemy-b23f8c0f2efea544954e1f6cfcdf4931b2f57213.tar.gz
- Fixed a bug with the unitofwork's "row switch" mechanism,
i.e. the conversion of INSERT/DELETE into an UPDATE, when combined with joined-table inheritance and an object which contained no defined values for the child table where an UPDATE with no SET clause would be rendered.
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/mapper.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index 04fc9d0ef..6bcc89b3c 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -1305,13 +1305,15 @@ class Mapper(object):
if col in pks:
if history.deleted:
params[col._label] = prop.get_col_value(col, history.deleted[0])
+ hasdata = True
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
+ else:
+ hasdata = True
elif col in pks:
params[col._label] = mapper._get_state_attr_by_column(state, col)
if hasdata: