mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-02 05:48:52 -04:00
- callcount
- more inlining
This commit is contained in:
@@ -1833,13 +1833,15 @@ class Mapper(object):
|
||||
|
||||
if primary_key is not None:
|
||||
# set primary key attributes
|
||||
for i, col in enumerate(mapper._pks_by_table[table]):
|
||||
if mapper._get_state_attr_by_column(
|
||||
state, state_dict, col) \
|
||||
is None and len(primary_key) > i:
|
||||
mapper._set_state_attr_by_column(
|
||||
state, state_dict, col,
|
||||
primary_key[i])
|
||||
for pk, col in zip(primary_key, mapper._pks_by_table[table]):
|
||||
# TODO: make sure this inlined code is OK
|
||||
# with composites
|
||||
prop = mapper._columntoproperty[col]
|
||||
if state_dict.get(prop.key) is None:
|
||||
# TODO: would rather say:
|
||||
# state_dict[prop.key] = pk
|
||||
# here, one test fails
|
||||
prop._setattr(state, state_dict, pk, col)
|
||||
|
||||
mapper._postfetch(uowtransaction, table,
|
||||
state, state_dict, c,
|
||||
|
||||
@@ -124,7 +124,7 @@ class ColumnProperty(StrategizedProperty):
|
||||
get_committed_value(state, dict_, passive=passive)
|
||||
|
||||
def _setattr(self, state, dict_, value, column):
|
||||
state.get_impl(self.key).set(state, dict_, value, None)
|
||||
state.manager[self.key].impl.set(state, dict_, value, None)
|
||||
|
||||
def merge(self, session, source_state, source_dict, dest_state,
|
||||
dest_dict, load, _recursive):
|
||||
|
||||
@@ -79,7 +79,9 @@ class MergeTest(_base.MappedTest):
|
||||
# using sqlite3 the C extension took it back up to approx. 1257
|
||||
# (py2.6)
|
||||
|
||||
@profiling.function_call_count(1257, versions={'2.4': 807})
|
||||
@profiling.function_call_count(1257,
|
||||
versions={'2.6+cextension':1194, '2.4': 807}
|
||||
)
|
||||
def go():
|
||||
p2 = sess2.merge(p1)
|
||||
go()
|
||||
|
||||
Reference in New Issue
Block a user