server/sources/rql2sql.py
branch3.5
changeset 3245 7ef021ac8dec
parent 3238 988a72e59b2b
child 3689 deb13e88e037
equal deleted inserted replaced
3244:1fc804b2c5ba 3245:7ef021ac8dec
   654                     return
   654                     return
   655                 # OPTIONAL relation, generate a left|right outer join
   655                 # OPTIONAL relation, generate a left|right outer join
   656                 sql = self._visit_outer_join_relation(relation, rschema)
   656                 sql = self._visit_outer_join_relation(relation, rschema)
   657             elif rschema.inlined:
   657             elif rschema.inlined:
   658                 sql = self._visit_inlined_relation(relation)
   658                 sql = self._visit_inlined_relation(relation)
   659 #             elif isinstance(relation.parent, Not):
       
   660 #                 self._state.done.add(relation.parent)
       
   661 #                 # NOT relation
       
   662 #                 sql = self._visit_not_relation(relation, rschema)
       
   663             else:
   659             else:
   664                 # regular (non final) relation
   660                 # regular (non final) relation
   665                 sql = self._visit_relation(relation, rschema)
   661                 sql = self._visit_relation(relation, rschema)
   666         return sql
   662         return sql
   667 
   663 
  1102             # XXX this check should be moved in rql.stcheck
  1098             # XXX this check should be moved in rql.stcheck
  1103             if self.schema.eschema(etype).is_final():
  1099             if self.schema.eschema(etype).is_final():
  1104                 raise BadRQLQuery(var.stmt.root)
  1100                 raise BadRQLQuery(var.stmt.root)
  1105             table = var.name
  1101             table = var.name
  1106             sql = '%s.%seid' % (table, SQL_PREFIX)
  1102             sql = '%s.%seid' % (table, SQL_PREFIX)
  1107             self.add_table('%s%s AS %s' % (SQL_PREFIX, etype, table), table, scope=scope)
  1103             self.add_table('%s%s AS %s' % (SQL_PREFIX, etype, table), table,
       
  1104                            scope=scope)
  1108         return sql, table
  1105         return sql, table
  1109 
  1106 
  1110     def _inlined_var_sql(self, var, rtype):
  1107     def _inlined_var_sql(self, var, rtype):
  1111         try:
  1108         try:
  1112             sql = self._varmap['%s.%s' % (var.name, rtype)]
  1109             sql = self._varmap['%s.%s' % (var.name, rtype)]