server/sources/rql2sql.py
branchstable
changeset 4286 6801093af29c
parent 4212 ab6573088b4a
child 4467 0e73d299730a
--- a/server/sources/rql2sql.py	Wed Jan 20 11:27:41 2010 +0100
+++ b/server/sources/rql2sql.py	Wed Jan 20 11:29:00 2010 +0100
@@ -1212,13 +1212,13 @@
     def _update_outer_tables(self, table, actualtables, oldalias, newalias):
         actualtables.remove(oldalias)
         actualtables.append(newalias)
+        self._state.outer_tables[table] = newalias
         # some tables which have already been used as outer table and replaced
         # by <oldalias> may not be reused here, though their associated value
         # in the outer_tables dict has to be updated as well
         for table, outerexpr in self._state.outer_tables.iteritems():
             if outerexpr == oldalias:
                 self._state.outer_tables[table] = newalias
-        self._state.outer_tables[table] = newalias
 
     def _var_table(self, var):
         var.accept(self)#.visit_variable(var)