# HG changeset patch # User Sylvain Thénault # Date 1275488105 -7200 # Node ID 8138d9c86ac8c44cd5dd7996691546c68d128dba # Parent 879590c52679b4f698a8db81e67aef787b03dd94# Parent 56784e46509f01ebb3d9d603fd1797d1f128a776 backport stable diff -r 879590c52679 -r 8138d9c86ac8 server/sources/rql2sql.py --- a/server/sources/rql2sql.py Wed Jun 02 15:29:18 2010 +0200 +++ b/server/sources/rql2sql.py Wed Jun 02 16:15:05 2010 +0200 @@ -1180,14 +1180,15 @@ def _temp_table_scope(self, select, table): scope = 9999 for var, sql in self._varmap.iteritems(): - if table == sql.split('.', 1)[0]: + # skip "attribute variable" in varmap (such 'T.login') + if not '.' in var and table == sql.split('.', 1)[0]: try: scope = min(scope, self._state.scopes[select.defined_vars[var].scope]) except KeyError: scope = 0 # XXX if scope == 0: - return 0 - return 0 + break + return scope def _var_info(self, var): try: diff -r 879590c52679 -r 8138d9c86ac8 test/unittest_entity.py --- a/test/unittest_entity.py Wed Jun 02 15:29:18 2010 +0200 +++ b/test/unittest_entity.py Wed Jun 02 16:15:05 2010 +0200 @@ -362,7 +362,7 @@ '''
lambda x: 1
 
''') - else + else: self.assertEquals(e.printable_value('data'), '''
lambda x: 1