merge stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Jun 2009 23:38:23 +0200
branchstable
changeset 2179 9d7bfbf70ed6
parent 2178 a73bf75a1ef9 (diff)
parent 2177 3454adb6164a (current diff)
child 2180 bf2e81fb52be
merge
doc/book/en/intro/foundations/index.rst
doc/book/en/intro/tutorial/blog-less-ten-minutes.rst
--- 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):
--- 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
--- 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: