stmt = table.update(clause)
return stmt
- statement = base_mapper._memo(('update', table), update_stmt)
+ cached_stmt = base_mapper._memo(('update', table), update_stmt)
for (connection, paramkeys, hasvalue, has_all_defaults), \
records in groupby(
rows = 0
records = list(records)
+ statement = cached_stmt
+
# TODO: would be super-nice to not have to determine this boolean
# inside the loop here, in the 99.9999% of the time there's only
# one connection in use
connection.dialect.supports_sane_multi_rowcount
allow_multirow = has_all_defaults and not needs_version_id
- if bookkeeping and mapper.base_mapper.eager_defaults:
+ if bookkeeping and not has_all_defaults and \
+ mapper.base_mapper.eager_defaults:
statement = statement.return_defaults()
elif mapper.version_id_col is not None:
statement = statement.return_defaults(mapper.version_id_col)
"""Emit INSERT statements corresponding to value lists collected
by _collect_insert_commands()."""
- statement = base_mapper._memo(('insert', table), table.insert)
+ cached_stmt = base_mapper._memo(('insert', table), table.insert)
for (connection, pkeys, hasvalue, has_all_pks, has_all_defaults), \
records in groupby(
rec[6],
rec[7])):
+ statement = cached_stmt
+
if not bookkeeping or \
(
has_all_defaults