Project

General

Profile

« Previous | Next » 

Revision 3121

db_xml.py: put_table(): Partitioning in_table: Adjust bounds of last partition to actual row #s included

View differences:

lib/db_xml.py
165 165
    # Partition in_table if needed
166 166
    in_row_ct = sql.table_row_count(db, in_table)
167 167
    if in_row_ct > partition_size:
168
        for start in xrange(0, in_row_ct, partition_size):
169
            db.log_debug('********** Partition: rows '+str(start)+'-'
170
                +str(start+partition_size)+' **********', level=1.2)
171
            pkeys_loc = put_table_(node, in_row_ct_ref, partition_size, start)
168
        end = in_row_ct
169
        if limit != None: end = start + limit
172 170
        
171
        for start_ in xrange(start, end, partition_size):
172
            limit_ = min(end - start_, partition_size)
173
            db.log_debug('********** Partition: rows '+str(start_)+'-'
174
                +str(start_ + limit_)+' **********', level=1.2)
175
            pkeys_loc = put_table_(node, in_row_ct_ref, limit_, start_)
176
        
173 177
        return pkeys_loc
174 178
    
175 179
    is_func = xml_func.is_func(node)

Also available in: Unified diff