(self, curs, op_map)
Process update list
Process update list
Process update list
def process_update(self, curs, op_map):
        """Process update list"""
        data = op_map['U']
        # original update list count
        real_cnt = len(data)
        # merged method loads inserts together with updates
        if self.method == METH_MERGED:
            data += op_map['I']
        cnt = len(data)
        if (cnt == 0):
            return
        self.log.debug("bulk: Updating %d rows in %s", cnt, self.table)
        # copy rows to temp
        self.bulk_insert(curs, data)
        if self.method == METH_CORRECT:
            # update main table from temp
            self.update(curs)
            # check count (only in direct mode)
            if self.conf.table_mode == 'direct' and cnt != curs.rowcount:
                self.log.warning("%s: Update mismatch: expected=%s updated=%d",
                        self.table, cnt, curs.rowcount)
        else:
            # delete from main table using temp
            self.delete(curs)
            # check count (only in direct mode)
            if self.conf.table_mode == 'direct' and real_cnt != curs.rowcount:
                self.log.warning("%s: Update mismatch: expected=%s deleted=%d",
                        self.table, real_cnt, curs.rowcount)
            # insert into main table
            if AVOID_BIZGRES_BUG:
                # copy again, into main table
                self.bulk_insert(curs, data, table = self.qtable)
            else:
                # insert from temp - better way, but does not work
                # due bizgres bug
                self.insert(curs)
def process_update ( self , curs , op_map ) : data = op_map [ 'U' ] # original update list count real_cnt = len ( data ) # merged method loads inserts together with updates if self . method == METH_MERGED : data += op_map [ 'I' ] cnt = len ( data ) if ( cnt == 0 ) : return self . log . debug ( "bulk: Updating %d rows in %s" , cnt , self . table ) # copy rows to temp self . bulk_insert ( curs , data ) if self . method == METH_CORRECT : # update main table from temp self . update ( curs ) # check count (only in direct mode) if self . conf . table_mode == 'direct' and cnt != curs . rowcount : self . log . warning ( "%s: Update mismatch: expected=%s updated=%d" , self . table , cnt , curs . rowcount ) else : # delete from main table using temp self . delete ( curs ) # check count (only in direct mode) if self . conf . table_mode == 'direct' and real_cnt != curs . rowcount : self . log . warning ( "%s: Update mismatch: expected=%s deleted=%d" , self . table , real_cnt , curs . rowcount ) # insert into main table if AVOID_BIZGRES_BUG : # copy again, into main table self . bulk_insert ( curs , data , table = self . qtable ) else : # insert from temp - better way, but does not work # due bizgres bug self . insert ( curs )