Project

General

Profile

« Previous | Next » 

Revision 5381

sql_io.py: put_table(): Resolving default value column: If ignoring all rows, use input cols directly instead of cols from joined-together input table. In addition to being simpler, this prevents the returned column's name from growing longer and longer as each iteration prepends its input table table name to the default value column name.

View differences:

lib/sql_io.py
394 394
    input_joins = [in_tables0]+[sql_gen.Join(v,
395 395
        {in_pkey: sql_gen.join_same_not_null}) for v in in_tables_]
396 396
    
397
    orig_mapping = mapping.copy()
397 398
    if mapping == {} and not is_function: # need >= one column for INSERT SELECT
398 399
        mapping = {out_pkey: None} # ColDict will replace with default value
399 400
    
......
676 677
    
677 678
    # Resolve default value column
678 679
    if default != None:
680
        if ignore_all_ref[0]: mapping.update(orig_mapping) # use input cols
679 681
        try: default = mapping[default]
680 682
        except KeyError:
681 683
            db.log_debug('Default value column '

Also available in: Unified diff