Project

General

Profile

« Previous | Next » 

Revision 3107

db_xml.py: put_table(): Subsetting in_table: Call put_table() recursively using put_table_() to ensure that limit and start are reset to their default values, in case the table gets partitioned (which needs up-to-date limit and start values)

View differences:

db_xml.py
146 146
    in_table = sql_gen.as_Table(in_table)
147 147
    in_table.set_srcs(sql_gen.src_self, overwrite=False)
148 148
    
149
    # Subset in_table
149
    def put_table_(node, in_row_ct_ref=None, limit=None, start=0):
150
        return put_table(db, node, in_table, in_row_ct_ref, row_ins_ct_ref,
151
            limit, start, on_error, parent_ids_loc, next)
152
    
153
    # Subset in_table if needed
150 154
    if limit != None or start != 0:
151 155
        full_in_table = in_table
152 156
        in_table = copy.copy(in_table) # don't modify input!
......
155 159
            start=start), into=in_table)
156 160
            # in_table will be shadowed (hidden) by the created temp table
157 161
        sql.add_pkey(db, in_table)
162
        return put_table_(node, in_row_ct_ref)
158 163
    
159
    def pkey(table): return sql.pkey(db, table, True)
160
    
161
    def put_table_(node):
162
        return put_table(db, node, in_table, None, row_ins_ct_ref,
163
            on_error=on_error, parent_ids_loc=parent_ids_loc, next=next)
164
    
165 164
    is_func = xml_func.is_func(node)
166 165
    out_table = name_of(node)
167 166
    
......
197 196
    
198 197
    no_empty = set([in_table])
199 198
    
199
    def pkey(table): return sql.pkey(db, table, True)
200
    
200 201
    # Remove any explicit pkey
201 202
    try: del row[pkey(out_table)]
202 203
    except KeyError: pass

Also available in: Unified diff