server/rqlannotation.py
changeset 7651 7c0af7ef3325
parent 7523 f6856231cc51
child 7707 936530f8d32c
equal deleted inserted replaced
7650:278fe9c1f3ad 7651:7c0af7ef3325
   200         diffscope_rels.add(rel)
   200         diffscope_rels.add(rel)
   201     # if DISTINCT query, can use variable from a different scope as principal
   201     # if DISTINCT query, can use variable from a different scope as principal
   202     # since introduced duplicates will be removed
   202     # since introduced duplicates will be removed
   203     if scope.stmt.distinct and diffscope_rels:
   203     if scope.stmt.distinct and diffscope_rels:
   204         return iter(_sort(diffscope_rels)).next()
   204         return iter(_sort(diffscope_rels)).next()
   205     # XXX  could use a relation for a different scope if it can't generate
   205     # XXX could use a relation from a different scope if it can't generate
   206     # duplicates, so we would have to check cardinality
   206     # duplicates, so we should have to check cardinality
   207     raise CantSelectPrincipal()
   207     raise CantSelectPrincipal()
   208 
   208 
   209 def _select_main_var(relations):
   209 def _select_main_var(relations):
   210     """given a list of rqlst relations, select one which will be used as main
   210     """given a list of rqlst relations, select one which will be used as main
   211     relation for the rhs variable
   211     relation for the rhs variable