# HG changeset patch # User Sylvain Thénault # Date 1246052303 -7200 # Node ID 9d7bfbf70ed660c6a1a582f91c09c9566140e425 # Parent a73bf75a1ef98c2c9e7f4f29a25e89484508095c# Parent 3454adb6164a8f7dedad51f4e25a389e50efc5ec merge diff -r 3454adb6164a -r 9d7bfbf70ed6 devtools/fake.py --- a/devtools/fake.py Fri Jun 26 14:43:28 2009 +0200 +++ b/devtools/fake.py Fri Jun 26 23:38:23 2009 +0200 @@ -173,6 +173,8 @@ def execute(self, *args): pass + unsafe_execute = execute + def commit(self, *args): self.transaction_data.clear() def close(self, *args): diff -r 3454adb6164a -r 9d7bfbf70ed6 server/msplanner.py --- a/server/msplanner.py Fri Jun 26 14:43:28 2009 +0200 +++ b/server/msplanner.py Fri Jun 26 23:38:23 2009 +0200 @@ -563,7 +563,9 @@ self._sourcesterms = {self.system_source: {}} elif not self.needsplit: if not allequals(self._sourcesterms.itervalues()): - for terms in self._sourcesterms.itervalues(): + for source, terms in self._sourcesterms.iteritems(): + if source is self.system_source: + continue if any(x for x in terms if not isinstance(x, Constant)): self.needsplit = True return diff -r 3454adb6164a -r 9d7bfbf70ed6 server/test/unittest_msplanner.py --- a/server/test/unittest_msplanner.py Fri Jun 26 14:43:28 2009 +0200 +++ b/server/test/unittest_msplanner.py Fri Jun 26 23:38:23 2009 +0200 @@ -1934,6 +1934,21 @@ [])], {'x': self.session.user.eid}) + def test_nonregr14_1(self): + repo._type_source_cache[999999] = ('CWUser', 'ldap', 999999) + self._test('Any X WHERE X eid %(x)s, X owned_by U, U eid %(u)s', + [('OneFetchStep', [('Any 999999 WHERE 999999 owned_by 999999', [{}])], + None, None, [self.system], {}, [])], + {'x': 999999, 'u': 999999}) + + def test_nonregr14_2(self): + repo._type_source_cache[999999] = ('CWUser', 'ldap', 999999) + repo._type_source_cache[999998] = ('Note', 'system', 999998) + self._test('Any X WHERE X eid %(x)s, X owned_by U, U eid %(u)s', + [('OneFetchStep', [('Any 999998 WHERE 999998 owned_by 999999', [{}])], + None, None, [self.system], {}, [])], + {'x': 999998, 'u': 999999}) + class MSPlannerTwoSameExternalSourcesTC(BasePlannerTC): """test planner related feature on a 3-sources repository: