Project

General

Profile

« Previous | Next » 

Revision 3432

sql_io.py: put_table(): Optimization for only literal values: Also support an empty in_tables list, for use by put()

View differences:

sql_io.py
259 259
        mapping = {out_pkey: None} # ColDict will replace with default value
260 260
    
261 261
    in_tables_ = in_tables[:] # don't modify input!
262
    in_tables0 = in_tables_.pop(0) # first table is separate
263
    in_pkey = sql.pkey(db, in_tables0, recover=True)
264
    in_pkey_col = sql_gen.as_Col(in_pkey, in_tables0)
262
    try: in_tables0 = in_tables_.pop(0) # first table is separate
263
    except IndexError: in_tables0 = None
264
    else:
265
        in_pkey = sql.pkey(db, in_tables0, recover=True)
266
        in_pkey_col = sql_gen.as_Col(in_pkey, in_tables0)
265 267
    
266 268
    # Determine if can use optimization for only literal values
267 269
    is_literals = not reduce(operator.or_, map(sql_gen.is_table_col,
268 270
        mapping.values()))
269 271
    is_literals_or_function = is_literals or is_function
270 272
    
271
    if is_literals:
272
        in_tables0 = None
273
        errors_table_ = None
274
    else:
275
        errors_table_ = errors_table(db, in_tables0)
273
    if in_tables0 == None: errors_table_ = None
274
    else: errors_table_ = errors_table(db, in_tables0)
276 275
    
277 276
    # Create input joins from list of input tables
278 277
    input_joins = [in_tables0]+[sql_gen.Join(v,

Also available in: Unified diff