Beispiel #1
0
 def getSoftwareDublicates(self,
                           clustername,
                           _select="*",
                           _limitup=0,
                           _limitdown=0,
                           _where=None,
                           _orderby=None):
     if _where == None:
         _where = list()
     # Quickhack to support mysql3
     if type(_where) == list:
         for i in range(len(_where)):
             _where[i] = "t1." + _where[i]
     limit = BaseDB.getLimit(_limitup, _limitdown)
     self.log.debug("where: %s" % (_where))
     _where.append("t1.clustername=\"%s\"" % (clustername))
     #        _where+=" AND ".join(_where)
     whereclause = BaseDB.resolveWhere(_where)
     orderbyclause = BaseDB.resolveOrderBy(_orderby)
     self.log.debug("whereclause: %s" % (whereclause))
     query="""SELECT DISTINCT %s FROM %s AS t1
 LEFT JOIN %s AS t2
    USING (clustername, name)
    %s
     AND (t1.version != t2.version OR t1.subversion != t2.subversion)
     %s %s;""" \
     %("t1."+", t1.".join(_select), self.tablename, self.tablename, whereclause, orderbyclause, limit)
     self.log.debug("query: %s" % (query))
     return self.selectQuery(query)
 def getSoftware(self, clustername, select="*", limitup=0, limitdown=0, where=None, orderby=None):
     if where==None:
         where=list()
     limit=BaseDB.getLimit(limitup, limitdown)
     where.append("clustername=\"%s\"" %(clustername))
     self.log.debug("where: %s" %(where))
     whereclause=BaseDB.resolveWhere(where)
     orderbyclause=BaseDB.resolveOrderBy(orderby)
     self.log.debug("whereclause: %s" %(whereclause))
     query="SELECT DISTINCT %s FROM %s %s %s %s;" %(", ".join(select), self.tablename, whereclause, orderbyclause, limit)
     self.log.debug("query: %s" %(query))
     return self.selectQuery(query)
Beispiel #3
0
 def getSoftware(self,
                 clustername,
                 select="*",
                 limitup=0,
                 limitdown=0,
                 where=None,
                 orderby=None):
     if where == None:
         where = list()
     limit = BaseDB.getLimit(limitup, limitdown)
     where.append("clustername=\"%s\"" % (clustername))
     self.log.debug("where: %s" % (where))
     whereclause = BaseDB.resolveWhere(where)
     orderbyclause = BaseDB.resolveOrderBy(orderby)
     self.log.debug("whereclause: %s" % (whereclause))
     query = "SELECT DISTINCT %s FROM %s %s %s %s;" % (", ".join(
         select), self.tablename, whereclause, orderbyclause, limit)
     self.log.debug("query: %s" % (query))
     return self.selectQuery(query)
    def getSoftwareDublicates(self, clustername, _select="*", _limitup=0, _limitdown=0, _where=None, _orderby=None):
        if _where==None:
            _where=list()
        # Quickhack to support mysql3
        if type(_where)==list:
            for i in range(len(_where)):
                _where[i]="t1."+_where[i]
        limit=BaseDB.getLimit(_limitup, _limitdown)
        self.log.debug("where: %s" %(_where))
        _where.append("t1.clustername=\"%s\"" %(clustername))
#        _where+=" AND ".join(_where)
        whereclause=BaseDB.resolveWhere(_where)
        orderbyclause=BaseDB.resolveOrderBy(_orderby)
        self.log.debug("whereclause: %s" %(whereclause))
        query="""SELECT DISTINCT %s FROM %s AS t1
    LEFT JOIN %s AS t2
       USING (clustername, name)
       %s
        AND (t1.version != t2.version OR t1.subversion != t2.subversion)
        %s %s;""" \
        %("t1."+", t1.".join(_select), self.tablename, self.tablename, whereclause, orderbyclause, limit)
        self.log.debug("query: %s" %(query))
        return self.selectQuery(query)