backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 04 Mar 2010 12:08:23 +0100
changeset 4797 c8d5fcc3d64a
parent 4796 a20edc0f8b30 (current diff)
parent 4794 81075b09ebf1 (diff)
child 4804 daa71eaf11e8
backport stable
--- a/server/sources/rql2sql.py	Thu Mar 04 12:08:09 2010 +0100
+++ b/server/sources/rql2sql.py	Thu Mar 04 12:08:23 2010 +0100
@@ -41,6 +41,8 @@
 from cubicweb.server.sqlutils import SQL_PREFIX
 from cubicweb.server.utils import cleanup_solutions
 
+ColumnAlias._q_invariant = False # avoid to check for ColumnAlias / Variable
+
 def _new_var(select, varname):
     newvar = select.get_variable(varname)
     if not 'relations' in newvar.stinfo:
@@ -711,7 +713,7 @@
         return '%s=%s' % (lhssql, rhsvar.accept(self))
 
     def _process_relation_term(self, relation, rid, termvar, termconst, relfield):
-        if termconst or isinstance(termvar, ColumnAlias) or not termvar._q_invariant:
+        if termconst or not termvar._q_invariant:
             termsql = termconst and termconst.accept(self) or termvar.accept(self)
             yield '%s.%s=%s' % (rid, relfield, termsql)
         elif termvar._q_invariant: