server/sources/rql2sql.py
branchstable
changeset 2915 651bbe1526b6
parent 2354 9b4bac626977
child 3238 988a72e59b2b
--- a/server/sources/rql2sql.py	Tue Aug 18 23:29:26 2009 +0200
+++ b/server/sources/rql2sql.py	Wed Aug 19 00:00:34 2009 +0200
@@ -1146,7 +1146,9 @@
             key = table
         if key in self._state.tables:
             return
-        self._state.tables[key] = (len(self._state.actual_tables) - 1, table)
+        if scope == -1:
+            scope = len(self._state.actual_tables) - 1
+        self._state.tables[key] = (scope, table)
         self._state.actual_tables[scope].append(table)
 
     def replace_tables_by_outer_join(self, substitute, lefttable, *tables):